Rich text / API
foldkit-richtext-dom/html
HTML import, constrained by a Kit (§70, §124 §10). The parser walks a DOMParser tree
with a whitelist: known block tags become blocks, known inline tags become marks, our
own data-* attributes round-trip, and everything else is unwrapped or dropped with a
diagnostic. Only a fixed few attributes are ever read — a link's href, an image's
src and alt — and each passes a scheme policy first (RichText.safeUrl), so a pasted
style, onclick, or javascript: URL cannot survive as anything executable, and
script/style/iframe content is dropped along with its element.
Functions
parseHtml | Parses HTML into semantic blocks, reporting everything it refused. |