Skip to content

Read a form feed as whitespace in the meta charset prescan - #2097

Open
xroche wants to merge 2 commits into
masterfrom
fz/B8
Open

xroche wants to merge 2 commits into
masterfrom
fz/B8

Conversation

@xroche

@xroche xroche commented Nov 7, 2026

Copy link
Copy Markdown
Owner

The <meta> charset prescan now treats a form feed as whitespace, as the WHATWG prescan does. So <meta\fcharset=windows-1251> is read, and an FF after an unquoted http-equiv value no longer leaks a closing quote into the charset. A vertical tab is still not whitespace, and the MIME sniffer keeps its own set.

Test 01_engine-charset asserted the old set only because #1516 pinned it during a rename. Its two FF rows flip, and the new FF and VT rows fail on master. A crawl of a page with that FF meta saves the link as да.html, where master saves äà.html. tools/parser-diff.sh against master shows no difference on any leg.

xroche and others added 2 commits November 7, 2026 18:46
The WHATWG prescan treats SPACE, TAB, CR, LF and FF as whitespace.
is_html_space() left FF out, so <meta\fcharset=latin1> found no charset,
and an FF after an unquoted http-equiv value merged it with the next
attribute, which leaked the closing quote into the charset name. VT is
still not whitespace there.

Test 01_engine-charset pinned the old set as a side effect of #1516's
rename; its two FF rows flip and new FF and VT rows are added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
A mutant that drops FF from is_html_space_or_equal alone passed the
test before these rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche enabled auto-merge (squash) November 7, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant