Repository navigation
fix(rules): report exposed and raw H1 counts separately in core/h1 - #1643
WilliamK112 wants to merge 10 commits into
Conversation
Closes squirrelscan#1636 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ching-Wei Kang <[email protected]>
|
Reviewed head: 8ce4734 Verdict: pending maintainer review. No correctness bugs found, but the change moves some pages from warn to pass, which is a scoring decision for the maintainer. Thanks for the thorough tests and docs. Findings, most severe first:
Checks against the acceptance criteria of #1636: Conventions: rule docs updated, CHANGELOG nik |
…ring note squirrelscan#1636 Signed-off-by: Ching-Wei Kang <[email protected]>
|
Thanks for the review. Addressed in
I also checked that the tests catch the bug: with |
|
Reviewed head: bee724a Verdict: pending maintainer review. Findings 2 to 5 from the last review are addressed; finding 1 is a maintainer design decision and is still open. Changes since the last reviewed head (8ce4734), one commit touching
Conventions: rule docs updated, CHANGELOG entry present, no new dependency, DCO sign-off present. CI: all 15 completed checks on this head are green, 1 skipped. nik |
…t-1636 Signed-off-by: Ching-Wei Kang <[email protected]> # Conflicts: # CHANGELOG.md
|
Reviewed head: fc9e7b1 Verdict: pending maintainer review. The only change since the last reviewed head (bee724a) is a merge of main that resolves the CHANGELOG conflict. The open design decision from the earlier reviews is still open. Findings, most severe first:
Conventions: rule docs updated, CHANGELOG nik |
|
maintainer call: one exposed H1 with other H1s hidden reports as warn. exposed and raw counts reported separately, as in this PR. nik |
…relscan#1636 Maintainer call on squirrelscan#1643: a page with one exposed H1 and hidden ones still warns, because crawlers that do not render the page read every H1. The message gives the exposed and raw counts separately, like the case with two or more exposed, and the value is the raw count. Also add a report-side test that these messages merge across pages. Signed-off-by: Ching-Wei Kang <[email protected]>
…t-1636 Signed-off-by: Ching-Wei Kang <[email protected]>
|
Done in 309c58d: one exposed H1 with the others hidden now warns as I also merged main. The v0.0.174 release had renamed |
|
The red Dependency audit is a new low-severity advisory for fast-xml-parser (GHSA-474x-hrwr-fgx4). This PR doesn't touch |
|
Reviewed head: 1f3587d Verdict: pending maintainer review. The maintainer decision from the last review (one exposed H1 with the rest hidden warns) is implemented; the findings below are minor. Maintainer decision: addressed. In Findings, most severe first:
Thanks for the quick turnaround on the decision. nik |
|
On 1: I kept that case on On 4: those reflows come from running the pinned |
…t-1636 Signed-off-by: Ching-Wei Kang <[email protected]> # Conflicts: # CHANGELOG.md
…t-1636 Signed-off-by: Ching-Wei Kang <[email protected]> # Conflicts: # CHANGELOG.md
…t-1636 Signed-off-by: Ching-Wei Kang <[email protected]> # Conflicts: # CHANGELOG.md
|
Reviewed head: 6895644 Verdict: pending maintainer review. Nothing in the PR's own code changed since the last reviewed head (1f3587d); the one open question is still the maintainer's call, and the branch now conflicts with main. Changes since the last reviewed head: 60 commits, almost all from main arriving through two merges (c177727, 6beacb2, 6895644). The Findings, most severe first:
Conventions: rule docs updated, CHANGELOG nik |
…unt-1636 Signed-off-by: Ching-Wei Kang <[email protected]> # Conflicts: # CHANGELOG.md
|
Merged current main in f1c98a2 and resolved the CHANGELOG conflict by keeping the #1636 bullet under the new Unreleased section. Revalidated the 34 focused rule/report tests, the changed rule files with the pinned formatter and linter, both rules and report typechecks, and diff whitespace; all pass. |
|
Reviewed head: f1c98a2 Verdict: pending maintainer review. The maintainer decision (one exposed H1 with the rest hidden warns, raw and exposed counts reported separately) is implemented, and nothing substantive changed since the last reviewed head (6895644). The branch still needs a conflict fix before it can land. Changes since the last reviewed head: one merge of main (f1c98a2). The only PR-owned code difference is a formatting-only reflow of the Findings, most severe first:
Conventions: rule docs updated, CHANGELOG entry present, no new runtime dependency. CI: 15 checks succeeded and 1 was skipped on this head. I did not run the tests. nik |
…unt-1636 # Conflicts: # CHANGELOG.md
|
Merged the latest Validation passed: 43 focused H1/report tests, 19 release/changelog tests, and |
Maintainer call on #1643: a page with one exposed H1 and hidden ones still warns, because crawlers that do not render the page read every H1. The message gives the exposed and raw counts separately, like the case with two or more exposed, and the value is the raw count. Also add a report-side test that these messages merge across pages. Signed-off-by: Ching-Wei Kang <[email protected]> Signed-off-by: Nik Cubrilovic <[email protected]>
Signed-off-by: Nik Cubrilovic <[email protected]>
|
Landed in bundle #1799, rebase-merged to main. nik |
Summary
core/h1sorts a page's H1s by static visibility with the sharedcreateStaticVisibilityreader (hidden, inlinedisplay:none/visibility:hidden, a closed<dialog>, decidable<style>rules) when the page has more than one.aria-hiddenis deliberately not read: it hides a heading from assistive technology, not from the pagerawCount, withexposedCountandhiddenCount(andunconfirmedCountwhen relevant) beside itMultiple H1 tags found (N), unchangedMultiple H1 tags found (2 exposed, 3 in the HTML; …), value = exposed countMultiple H1 tags found (1 exposed, 3 in the HTML; …), value = raw count, orH1 tag is emptywhen that H1 is emptyh1-unconfirmedwarn, per theUNCONFIRMED_CHECK_SUFFIXconvention<style>blocks, and that an HTTP-only audit cannot resolve visibility set by external stylesheets or scriptsCloses #1636
Acceptance criteria
details.rawCount)hiddenand inlinedisplay:none) is reported separately (details.exposedCount)/hidden-h1(one exposed, two hidden) does not message as three visible headings/visible-h1(three exposed) still warns as multiple H1s, message unchangedpackages/rules/tests/h1-exposed-count-1636.test.ts)Verification
bun test ./packages/rules/tests/h1-exposed-count-1636.test.ts— 12 pass, 0 fail; withsrc/core/h1.tsreverted tomain, 8 of the 12 fail, and with the one-exposed case set back to pass, 3 failbun run scripts/test-suites.ts --run rules— 10,019 pass, 25 todo, 0 failbun run scripts/test-suites.ts --run report— 1,193 pass, 0 fail (includes a new test that the(N exposed, M in the HTML; …)messages merge across pages)bun run scripts/test-suites.ts --run audit-engine— 1,923 pass, 3 skip, 1 fail:template-fanout-equivalence-golden.test.tsbuilds a path withnew URL(...).pathname, which can't be opened from my checkout because its path has a space; unrelated to this changebun run --cwd packages/rules typecheck,bun run --cwd packages/report typecheckbun run lint,bun run format:checkbun run docs:check— all checks passedoxlint -c apps/cli/oxlint.config.mjson the changed files: clean; the test file is formatted with the pinnedoxfmt(the existingh1.tsis not oxfmt-clean onmain, so it was not reflowed)Checklist
Signed-off-byline (git commit -s).Docs:
docs/rules/core/h1.mdx. Skill: none.