Skip to content

core/meta-description: Latin-length floor warns on complete CJK descriptions #1866

Closed

Description

@deniskern

Tested native manifest-verified squirrel v0.0.180 and v0.0.182 (darwin-arm64). core/meta-description warns on the following Chinese description despite lang="zh-CN":

<!doctype html><html lang="zh-CN"><head><meta charset="utf-8">
<title>Bowling rental shoes for a professional bowling center</title>
<meta name="description" content="真皮租借保齡球鞋,EU 尺寸 24–52,自 2003 年起供應保齡球館。可採用您的配色並加上您的標">
</head><body><main><h1>租借保齡球鞋</h1></main></body></html>

Save as index.html, serve with python3 -m http.server 18893 --bind 127.0.0.1, then run with a fresh HOME:

HOME="$(mktemp -d)" NO_TELEMETRY=1 SQUIRREL_NO_UPDATE=1 squirrel audit http://127.0.0.1:18893/ --http --offline --no-publish --refresh --passive --disable-discovery-probes --target-url http://127.0.0.1:18893/ --rule-include core/meta-description -m 1 -f json -o out.json

Actual: meta-description-too-short, Description too short (50 chars, min 120). The same fixture matrix warns for complete Japanese, Korean and Thai descriptions (50–101 characters), while a 140-character English description passes. A 300-character Korean positive control still correctly triggers meta-description-too-long.

Expected: do not diagnose a complete CJK description as unsuitable solely because it is shorter than the Latin 120-character heuristic. At minimum, make the language/script limitation explicit in the warning and its suggested remedy. This is not a request to waive missing descriptions or prescribe unvalidated language-specific numeric limits; Thai grapheme counting may need separate treatment.

The tagged implementation measures description.length and applies the same default 120–160 range regardless of language. Length alone is not a universal snippet-width measure: CJK glyphs and Latin text have different widths. Multilingual sites consequently receive repeated warnings that encourage unnecessarily padding already useful descriptions. Explicit global min_length overrides do not provide per-language behavior within one multilingual crawl.

Searched all-state issues/PRs for meta-description, CJK, Chinese, Japanese, Thai, description length and 120. #841 concerns contact/legal/noindex page types, not script-aware lengths; no matching language-length report found in those searches.

Triage

Confirmed against current main. packages/rules/src/core/meta-description.ts measures description.length (UTF-16 code units) and compares it to the min_length (120) and max_length (160) defaults regardless of the page's lang or the script of the text. A complete 50-character Chinese, Japanese or Korean description therefore reports meta-description-too-short, and the suggested remedy tells the author to pad it. Related closed work: #841 (page-type skips) and #1765 (two-sided length messages). Neither covers script-aware length.

Acceptance Criteria

  • The reporter's zh-CN fixture (50-character description) no longer reports meta-description-too-short with the default options.
  • Complete Japanese, Korean and Thai descriptions of 50 to 101 characters no longer report meta-description-too-short with the default options.
  • A 140-character English description still passes, and a short English description still reports meta-description-too-short.
  • A 300-character Korean description still reports meta-description-too-long.
  • A missing or empty description is still reported as missing for every language.
  • If the floor is still applied to any script, the warning message and the suggested remedy name the language or script limitation instead of only telling the author to lengthen the text.
  • The rule docs (docs/rules/core/meta-description.mdx) describe the language and script behavior, and tests cover each case above.

Generated by Claude Code

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