diff --git a/README.md b/README.md index cfa874f..521223e 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ const page: AdfDocument = { version: 1, } -// URLs are written as the ADF holds them, javascript: included: sanitize HTML from an author you do not trust before showing it. +// Sanitize HTML from an author you do not trust before showing it: URLs are written as the ADF holds them, javascript: included. const html = adfToHtml(page) if (html.ok) console.log(html.value) //

Release notes

diff --git a/docs/decisions.md b/docs/decisions.md index f9970b9..85f412d 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -840,19 +840,20 @@ that, JavaScriptCore throws `Out of memory`, which is `engine-limit` (§Which co ## HTML writes a URL as the ADF holds it, whatever its scheme -2026-10-23, the maintainer; weighed against a filter 2026-10-26. Goal 1. Valid until a security -addition filters schemes. +2026-10-23, the maintainer; kept over a scheme filter 2026-10-26. Goal 1. Valid until the maintainer +adds scheme filtering. `adfToHtml` writes every URL exactly as the ADF holds it, escaped as every attribute value is, `javascript:`, `vbscript:`, `file:` and `data:` included. That covers a link's `href`, an image's `src`, and the `href` of each link the carry element shows: a carried node's link mark, a card's -`url` or `data.url`, and an external image's `url`. The markdown writers do the same. +`url` or `data.url`, and an external image's `url`. The markdown writers don't filter schemes +either. -Keeping such a URL out of the visible HTML, in `data-adf` alone, as cmark does by default, was -weighed and not taken: it would make the carry show a link without its target, make `htmlToAdf` -restore the URL from `data-adf`, and need a scheme list the library keeps current. Sanitizing HTML -from an author a consumer does not trust stays the consumer's, as the README says. The maintainer -left a scheme filter for a later security addition. +cmark leaves such a URL out of its HTML by default. Keeping it out of the visible HTML here, in +`data-adf` alone, was weighed and not taken: it would make the carry show a link without its +target, make `htmlToAdf` restore the URL from `data-adf`, and need a scheme list the library keeps +current. Sanitizing HTML from an author a consumer does not trust stays the consumer's, as the +README says. ## Nothing recurses unbounded