Skip to content

core/h1: distinguish raw counts from exposed experiment headings #1636

Closed

Description

@deniskern

Summary: .173 reports Multiple H1 tags found (3) for /hidden-h1 (one exposed H1, two hidden alternatives) identically to /visible-h1 (three exposed H1). Minimal HTML: <h1>Primary</h1><h1 style="display:none">Alternative</h1><h1 hidden>Alternative</h1>. Actual: warn with value=3; expected: retain raw SEO count as diagnostic, separately report exposed count/uncertainty rather than imply three visible headings. Control: three exposed headings must still be identifiable as multiple. Tagged source packages/rules/src/core/h1.ts uses ctx.parsed.h1.count only. HTTP rendering limits must remain explicit; no customer-specific exemption.

Triage

The parser counts every h1 element without a visibility check, and packages/rules/src/core/h1.ts warns Multiple H1 tags found (N) on that raw ctx.parsed.h1.count alone. A page with one exposed H1 and two hidden or display:none alternatives is therefore reported the same as three exposed H1s. Confirmed against the report.

Acceptance Criteria

  • The raw H1 count stays available as a diagnostic value on the check
  • The exposed H1 count (excluding hidden and inline display:none) is reported separately
  • /hidden-h1 (one exposed, two hidden) does not message as three visible headings
  • /visible-h1 (three exposed) still warns as multiple H1s
  • The message states that HTTP-only rendering cannot resolve CSS-driven visibility
  • Unit tests cover the hidden and visible cases

Generated by Claude Code

Activity

  1. added
    bug
    rules
    size: S
    on Nov 8, 2026
  2. added theissue type on Nov 8, 2026
  3. added a commit that references this issue on Nov 14, 2026
    58b6de2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrulessize: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions