Skip to content

core/meta-title: title length counts raw whitespace #658

Closed

Description

@deniskern

Summary. Title too long measures the raw <title> source including indentation and
line breaks. Browsers display the title with whitespace collapsed, so themes that indent
the title (Shopware, Shopify) are flagged although the visible title is short.

Data. Across 84 audited sites, core/meta-title holds 13,193 open "too long"
findings on 80 sites (total, not all confirmed as whitespace cases). Live example:
motorroller.de /tret-und-kinderroller/: raw 83 characters, whitespace-collapsed 50.

Repro. Serve title.html with node -e "require('http').createServer((q,r)=>{r.setHeader('content-type','text/html; charset=utf-8');r.end(require('fs').readFileSync('title.html'))}).listen(8765)":

<!doctype html><html lang="de"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
                                        Tret- &amp; Kinderroller kaufen - Preiswert
                                        </title>
</head><body><h1>Roller</h1></body></html>

Control: identical page with <title>Tret- &amp; Kinderroller kaufen - Preiswert</title>.

squirrel --version   # 0.0.108
squirrel audit http://127.0.0.1:8765/ --http --refresh -m 1 -f json -o out.json
  • Actual: padded page → core/meta-title check meta-title status warn, message
    Title too long; control page → no warning.
  • Expected: both pages identical. Measure the length after collapsing ASCII whitespace
    runs to one space and trimming (as the displayed title), and report the collapsed text.

Verified on 0.0.108 with the control page: padded title warns, control passes.

Acceptance Criteria

  • The padded fixture (indented, line-broken title) and the control produce the same core/meta-title result.
  • The length is measured after collapsing runs of ASCII whitespace to one space and trimming.
  • The finding's value and item label show the collapsed text, not the raw source.
  • A genuinely long collapsed title (over max_length) still warns, and a short one still warns as too short.
  • A test covers padded, control, tabs/newlines, and the over-long case.

Activity

  1. added
    bug
    P2
    rules
    size: S
    on Oct 11, 2026
  2. nc9 commented on Oct 11, 2026

    @nc9
    Contributor

    Thanks Denis. Confirmed from the code on current main: core/meta-title measures title.length on the raw title, so indentation and line breaks count toward the limit. Triaged as a bug (P2: it fires on 80 of your 84 sites), size S, area rules. I added acceptance criteria to the description. The fix is to collapse whitespace before measuring and report the collapsed text. I'll queue it with the other rule fixes in this batch.

  3. nc9 commented on Oct 12, 2026

    @nc9
    Contributor

    Fixed in # and merged to main. Every acceptance criterion is met per the PR description, with before and after evidence from the CLI on local fixtures, tests that fail on the old code, and review comments triaged. Criteria ticked.

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

    P2bugrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions