diff --git a/.planning/notes/2026-11-14-mail-url-scheme-check.md b/.planning/notes/2026-11-14-mail-url-scheme-check.md
index c5162ba7..ceae4fb2 100644
--- a/.planning/notes/2026-11-14-mail-url-scheme-check.md
+++ b/.planning/notes/2026-11-14-mail-url-scheme-check.md
@@ -1,7 +1,7 @@
# Decision: postcard checks URL schemes in decoded attribute values, never lets a site name stop a send, and prints the footer name literally
**Date:** 2026-11-14
-**Status:** Accepted; amended the same day by the review fixes of 35-REVIEW.md (re-review of 35-08/35-09): CR-01 residual, CR-02, WR-01, WR-02, WR-03 (see "Amendment" below)
+**Status:** Accepted; amended the same day by the review fixes of 35-REVIEW.md (re-review of 35-08/35-09): CR-01 residual, CR-02, WR-01, WR-02, WR-03 (see "Amendment" below); amended again by quick task 261114-p5m (CR-02 residual: an end tag inside a quoted attribute)
**Context:** Phase 35 re-verification gap (35-VERIFICATION.md `gaps:`, the CR-01 regression), 35-REVIEW.md CR-01, WR-01 and WR-05, Jakub's decisions of 2026-11-14 (two plans: this fix in 35-08, then the regression and unit tests in 35-09; WR-01 and WR-05 bundled with CR-01), plan 35-08
## The problem
@@ -26,7 +26,7 @@ The rendered HTML is read with `golang.org/x/net/html`'s tokenizer (already a di
- **Single-URL attributes** (`urlAttributes`): `action`, `background`, `cite`, `codebase`, `data`, `dynsrc`, `formaction`, `href`, `icon`, `longdesc`, `lowsrc`, `manifest`, `poster`, `profile`, `src`, `usemap`, `xlink:href`, and the SVG animation targets `from`, `to`, `by`. A value is refused when, decoded, with every ASCII whitespace and control character (U+0000 to U+0020 and U+007F) removed and lower-cased, it starts with `javascript:`, `vbscript:` or `data:` (`hasDangerousScheme`). Removing whitespace closes tab- and newline-split schemes.
- **List-valued attributes** (`urlListAttributes`: `srcset`, `ping`, `archive`, `values`), **`style` attributes**, the **`content` attribute of `meta` elements**, the **text of `style` elements** and **comment data**: refused when the existing `dangerousScheme` pattern matches anywhere in the decoded value with whitespace and control characters removed (`stripURLSpace`, shared with `hasDangerousScheme`; WR-01), so `values="java script:..."` is refused. The conservative rule stays for CSS and lists, where prose does not belong.
-- **Raw-text elements and comments are checked as markup too** (CR-02). The tokenizer reads the content of `iframe`, `noembed`, `noframes`, `noscript`, `plaintext`, `script`, `style`, `textarea`, `title` and `xmp` as one text token, also after a self-closing start tag. A mail client may parse it as markup (it renders with scripting off, so `noscript` content is markup; inside `svg`/`math` these are foreign elements with markup children), so `unsafeMarkup` checks the raw source of that content, and the data of every comment (Outlook conditional comments), again as markup. Each nested check reads a strictly shorter text; nesting deeper than eight levels (`maxMarkupDepth`) is refused ("rendered HTML nests raw-text elements or comments too deeply"). The raw source, not the decoded text, is re-read, so `<a href=...>` in a `title` stays text.
+- **Raw-text elements and comments are checked as markup too** (CR-02). The tokenizer reads the content of `iframe`, `noembed`, `noframes`, `noscript`, `plaintext`, `script`, `style`, `textarea`, `title` and `xmp` as one text token, also after a self-closing start tag. A mail client may parse it as markup (it renders with scripting off, so `noscript` content is markup; inside `svg`/`math` these are foreign elements with markup children), so `unsafeMarkup` checks the raw source of that content, and the data of every comment (Outlook conditional comments), again as markup. Each nested check reads a strictly shorter text; nesting deeper than eight levels (`maxMarkupDepth`) is refused ("rendered HTML nests raw-text elements or comments too deeply"). The raw source, not the decoded text, is re-read, so `<a href=...>` in a `title` stays text. After this HTML reading, `unsafeMarkup` reads the same text once more as tags only (`unsafeTagReading`, quick 261114-p5m): x/net/html's tokenizer with `NextIsNotRawText()` called after every raw-text start tag, and the `<` of each `" href="javascript:...">` are refused. The same attribute checks and messages apply (`unsafeAttrs`, shared by both readings). Both readings run at every depth, both are linear, and the depth limit is unchanged.
- **Text content is not checked for schemes.** It is not a URL; a mail client does not follow it. `metadata:` or `Big Data: Summit` in a body, a header or a footer passes.
- **Event handlers.** The raw-markup regex for `script`/`iframe`/`object`/`embed` tags stays as it is and runs first. Event handlers are attributes only: the tokenizer walk refuses any attribute whose name starts with `on`, with or without whitespace before it (`
`), also inside raw-text elements and comments. The whole-document regex for whitespace-prefixed `on*=` is dropped (WR-02): it read text as well, so a variable such as `buy one = get one free` stopped its own message, and the footer's `© Online=Shop` stopped every send (CR-01 residual).
- **Error messages are unchanged** ("rendered HTML contains a dangerous URL scheme", "rendered HTML contains event handlers"). The snippet is the raw markup of the offending token, so an editor error shows the encoded form the administrator wrote.
@@ -53,12 +53,15 @@ The `footer` partial gains a `text` argument, printed as plain text (a paragraph
- **Keep the whole-document regex and only guard the site name.** Body text and other configuration text (`metadata:` in a template body, a variable, a partial argument) would keep stopping sends.
- **A bluemonday-based mail sanitizer.** It rewrites instead of refusing, and would need a mail allowlist for style elements, tables and layout attributes. The 2026-10-11 note scopes bluemonday to stored rich text; this check only locates attribute values with x/net/html and keeps postcard's refuse-and-fall-back contract.
- **Failing the render when the inlined result fails the check** (the reviewer's alternative for WR-05). It stops mail that passed the check, contradicts the documented promise and D-14.
+- **Re-checking from a raw-text element's content start to the end of the document** (for the CR-02 residual). Inside the recursion it re-reads the rest of the document once per raw-text element and comment, which is quadratic or worse on hostile input.
+- **Using the x/net/html parse tree as the check.** It loses the raw snippet the editor shows, reads `xmp` and `noembed` as raw text and ends a conditional comment at the first `-->`, while CR-02 deliberately checks that content as markup.
## Residual risk accepted
- CSS escape sequences inside CSS (`\6a avascript:`) are not decoded. Mail clients do not run script URLs from CSS.
- Re-reading raw-text element and comment content as markup over-refuses in the rare case where a client would read it as text (an HTML-context `textarea` holding markup, a CSS string holding ``). No mail markup needs either.
- html/template escapes a template's literal `title` and `textarea` text itself, so an `