Skip to content

Commit c882092

Browse files
hotlongclaude
andauthored
test(formula): pin the refused direction of the hole placement scan's tag-open and script escape corrections (#25351) (#25730)
Closes #25351 The maintainer's action on #25351, written under the maintainer's delegation in chat: two refused-direction rows in the class-by-class refused table of `packages/formula/src/mail-html-hole-placement.test.ts`, one per scan correction of `86330c090` (PR #25212), as contract review `6342085020` ③ asked. Test-only: no change to the classifier, the rule, its doors or the renderer. Per the card's disclosure rule, this body names each row by class only; the samples live in the test source. ## The two rows 1. **The tag-open state.** A hole inside a tag that opens immediately after a character the tag open state reconsumes in the data state answers `tag` and is refused. 2. **A script element's escape states.** A hole after an end tag in a script element's double-escaped text answers `raw-text-element` and is refused. Both rows were built from the HTML Living Standard's tokenizer section (the tag open state; the script data escaped and double escaped states). ## Ablation (local, against the classifier at this PR's base) Each correction of `86330c090` in `packages/formula/src/mail-html-hole-placement.ts` was reverted on its own, the file run, and the correction re-applied; the file was byte-identical to the base after each restore. | Correction reverted | Rows red | Reading | | --- | --- | --- | | Tag open state: reconsume in the data state (back to a plain return to data) | 1 of 48: the `tag` row added here | expected `tag`, received `element-text` | | Script escape states: the escape flag's arm/disarm and the end-tag guard removed | 1 of 48: the `raw-text-element` row added here | expected `raw-text-element`, received `element-text` | With both corrections in place: 48 of 48 pass in this file. ## Verification - `packages/formula`: `vitest run`, 53 files and 1424 tests pass; `pnpm typecheck` (including `check:test-typecheck`) passes. - `eslint` on the changed file: clean. ## Declarations Clause-②: no Metadata-protocol: none Test-only, so no changeset: the diff publishes nothing from any released package, and this PR carries `skip-changeset`, as the card's acceptance states. --- _Generated by [Claude Code](https://claude.ai/code)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent ec4ef94 commit c882092

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎packages/formula/src/mail-html-hole-placement.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ describe('the refused placements, by class', () => {
5959
['<style>p { color: {{x}} }</style>', 'raw-text-element'],
6060
['<noscript>{{x}}</noscript>', 'raw-text-element'],
6161
['<plaintext>{{x}}', 'raw-text-element'],
62+
// The script data double escaped state: an end tag there does not end the element.
63+
['<script><!--<script></script>{{x}}</script>', 'raw-text-element'],
6264
['<!-- {{x}} -->', 'comment'],
6365
['<!--[if mso]><p>{{x}}</p><![endif]-->', 'comment'],
6466
['<!DOCTYPE {{x}}>', 'comment'],
@@ -68,6 +70,8 @@ describe('the refused placements, by class', () => {
6870
['<p {{x}}>a</p>', 'tag'],
6971
['<{{x}}>', 'tag'],
7072
['</{{x}}>', 'tag'],
73+
// The tag open state: a character that opens no tag is reconsumed in the data state.
74+
['<<p {{x}}>a</p>', 'tag'],
7175
['<p title="a"{{x}}>a</p>', 'tag'],
7276
['<p data-{{x}}="1">a</p>', 'tag'],
7377
['<a href="{{x}}">a</a>', 'url-attribute'],

0 commit comments

Comments
 (0)