Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

HTMLAnchorElement throws with malformed URLs

オープン
#316 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
web-dev

調査の方向性

% のような不正な URL で失敗を再現し、cjs/html/anchor-element.js の 19 行目付近と、PR #204 による変更を確認してください。HTMLAnchorElement が不正な URL によって HTML の生成を中断しなくなっていること、および既にエンコードされた文字の既存の処理が維持されていることを検証してください。

索引モデルが issue の本文から書いたものです。

説明

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)
主要言語
HTML
スター
2.1k
フォーク
108
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WebReflection/linkedom のほかの issue

WebReflection/linkedom の issue をすべて見る

似ている issue

Web Dev の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。