Commit 1d5d6d3
authored
refactor: jsdom + DOMPurify を sanitize-html + htmlparser2 に置き換え (#11)
* refactor: jsdom + DOMPurify を sanitize-html + htmlparser2 に置き換え
jsdom は CF Workers と非互換のため、DOM 不要な sanitize-html に移行。
embed-block.ts を sanitize-html + htmlparser2 ベースにリライトし、
公開 API は維持したまま全33テストが通過することを確認。
* fix: ネストされた iframe の検出漏れを修正し domhandler を直接依存に追加
findIframes を再帰走査に変更し、ネストされた iframe も検出するよう修正。
domhandler を transitive dependency に頼らず直接 dependency として宣言。
* fix: iframe の width/height/title 属性を allowedAttributes に追加
DOMPurify のデフォルト allowlist で許可されていた width, height, title が
sanitize-html の設定から漏れており、embed のサイズ指定が失われるリグレッションを修正。
* fix: iframe の allowedAttributes に改行を追加し可読性を向上1 parent 4900581 commit 1d5d6d3
File tree
3 files changed
+87
-144
lines changed- packages/render
- src/elements
3 files changed
+87
-144
lines changed
0 commit comments