3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-17 05:40:26 +01:00

Answer prose round 1: 0 🔴, 1 🟡 (0 misread); the decision's premise named, its claims split

This commit is contained in:
2026-10-26 21:07:47 +01:00
committed by Lillem4n
parent f9e57d4c51
commit c47bea4102
2 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -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)
// <h2 data-local-id="a1f3">Release notes</h2>
+9 -8
View File
@@ -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