Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

HTMLAnchorElement throws with malformed URLs

Aperta
#316 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
web-dev

Direzione di ricerca

Riproduci il malfunzionamento con un URL malformato come %, quindi esamina cjs/html/anchor-element.js intorno alla riga 19 e la modifica di PR #204. Verifica che HTMLAnchorElement non interrompa più la generazione di HTML per gli URL malformati, mentre la gestione esistente dei caratteri già codificati rimane intatta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

We use LinkeDOM with Lexical to export HTML from an EditorState on the backend.
The PR #204 introduced decodeURI on get href() and get download() to fix double encoding of already encoded characters but this causes every malformed URL to throw URIError.

For example, a LinkNode in Lexical can be anything, can also have % as URL. When it comes to converting the LinkNode to an HTMLAnchorElement via LinkeDOM, decodeURI throws and the whole HTML generation fails.

It's not a real problem, I can sanitize these URLs myself, but I wanted to report this anyway. Thanks a lot for everything, LinkeDOM is really fast!

Logs
URIError: URI malformed
at decodeURI (<anonymous>)
at set href (/var/app/current/node_modules/linkedom/cjs/html/anchor-element.js:19:55)
at y.updateLinkDOM (file:///var/app/current/node_modules/@lexical/link/LexicalLink.prod.mjs:9:1231)
at y.createDOM (file:///var/app/current/node_modules/@lexical/link/LexicalLink.prod.mjs:9:1125)
at y.exportDOM (file:///var/app/current/node_modules/lexical/Lexical.prod.mjs:9:32114)
at y.exportDOM (file:///var/app/current/node_modules/lexical/Lexical.prod.mjs:9:88429)
at x (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1403)
at x (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1543)
at x (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1543)
at g (file:///var/app/current/node_modules/@lexical/html/LexicalHtml.prod.mjs:9:1128)
Lingua principale
HTML
Stelle
2.1k
Fork
108
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebReflection/linkedom

Tutte le issue di WebReflection/linkedom

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.