Repository navigation
Description
Summary
links/anchor-mismatch warns on meaningful German navigation labels because no whitespace token equals a target word:
Handschuhe→Fahrradhandschuhe: an ordinary noun is the suffix of a German compound.Alle Artikel→ a cycling tips blog: a contextual navigation label truthfully names the article listing.
This differs from the hyphenated/closed-form equality fixed in links/anchor-mismatch: German hyphenated compound does not match its closed form ("Online-Shop" vs "Onlineshop") #1598.
Inline reproduction
The exact navigation markup/title pairs below were tested as part of a deterministic 20-page multi-rule loopback fixture on both checksum-verified binaries, each with a fresh HOME and 20 audited pages. This standalone server extracts those three pages; it is not a claim that an entire live-site group is false positive.
Save as navigation-repro.mjs:
import http from 'node:http';
const origin = 'http://127.0.0.1:18772';
http.createServer((req, res) => {
const path = new URL(req.url, origin).pathname;
if (path === '/robots.txt') return res.end('User-agent: *\nAllow: /');
const pages = {
'/': ['Navigation', '<a href="/gloves">Handschuhe</a><a href="/articles">Alle Artikel</a>'],
'/gloves': ['Fahrradhandschuhe', ''],
'/articles': ['Tipps & Tricks rund ums Radfahren', ''],
};
const page = pages[path];
if (!page) { res.statusCode = 404; return res.end('Not found'); }
const [title, links] = page;
res.setHeader('content-type', 'text/html; charset=utf-8');
res.end(`<!doctype html><html lang="en"><head><meta charset="utf-8"><title>${title}</title><link rel="canonical" href="${origin}${path}"></head><body><main><h1>${title}</h1><p>${('A detailed collection of comfortable cycling products and business services for everyday journeys. ').repeat(12)}</p>${links}</main></body></html>`);
}).listen(18772, '127.0.0.1');Run node navigation-repro.mjs, then audit with each version in a fresh HOME:
SQUIRREL_NO_UPDATE=1 SQUIRREL_UPDATE_REEXEC=1 "$BIN" audit http://127.0.0.1:18772/ --http --offline --no-publish --refresh --passive --disable-discovery-probes --level full -m 30 --rule-include links/anchor-mismatch -f json -o "$OUT"The measured multi-case invocation used the same flags and included this rule alongside schema/entity-conflicts, links/broken-anchors, content/mojibake, a11y/image-redundant-alt, a11y/aria-labels, a11y/button-name and a11y/aria-required-parent. The standalone extraction above has not been separately rerun here.
Measured version comparison
| Version | Handschuhe → Fahrradhandschuhe | Alle Artikel → cycling tips blog |
|---|---|---|
| v0.0.171 | warns | warns |
| v0.0.172 | warns | warns |
Expected
Do not present these pairs as proven misleading anchors solely because they share no whitespace token. Recognize a meaningful compound constituent or report lexical uncertainty, and distinguish generic listing/navigation context from genuinely unrelated text. Keep genuinely misleading labels actionable, with a positive control for an unrelated visible anchor. No local suppression or content rewrite was added.
Triage
Confirmed against current code. tokensMatch in packages/rules/src/links/anchor-mismatch.ts matches two tokens only when they are equal or one is a prefix of the other (3+ shared characters, at most 3 left over). "handschuhe" is a suffix of "fahrradhandschuhe", so it never matches. The glue check (sharesInsideGlue) only looks for a target word inside an anchor word, not the reverse. Generic listing labels such as "Alle Artikel" have no lexical link to the target title, so the pair is judged unrelated. #1598 fixed the hyphenated vs closed form case only; this is a separate gap (suffix compounds and generic listing context).
Acceptance Criteria
- "Handschuhe" linking to a page titled "Fahrradhandschuhe" does not produce a
links/anchor-mismatchwarning. - A generic listing or navigation label (for example "Alle Artikel") pointing at an article listing page is not reported as a misleading anchor, or is reported as not judged rather than as a mismatch.
- A genuinely unrelated visible anchor (positive control) still warns.
- Unit tests in
packages/rules/tests/anchor-mismatch.test.tscover the compound suffix case, the listing label case and the positive control. -
docs/rules/links/anchor-mismatch.mdxdescribes the new compound and generic label handling.
Generated by Claude Code
Activity
fix(rules): listing target is the last path segment, soft-hyphen moji…
fix(rules): links/anchor-mismatch handles compound head nouns and gen…
docs(changelog): unreleased notes for #1623 and #1626
fix(rules): listing target is the last path segment, soft-hyphen moji…
fix(rules): links/anchor-mismatch handles compound head nouns and gen…
docs(changelog): unreleased notes for #1623 and #1626
fix(rules): listing target is the last path segment, soft-hyphen moji…
nc9 commentedon Nov 7, 2026
Fixed on main in 4b12d9f (compound head nouns and generic listing labels, tests for the compound case, the listing label and the positive control) and 048a089 (a listing is the last path segment only, so one article under /blog/ still warns), docs and changelog in 105d545. One known limitation is documented in the rule: the compound match is not gated by page language. It ships in the next release.
nik
deniskern commentedon Nov 8, 2026
Thank you for the .173 fix. The compound and
/articleslisting controls now pass as intended, while an unrelated anchor still warns. One original local case remains:<a href="/blogs/tipps-und-tricks">Alle Artikel</a>pointing at a genuine blog index titledTipps & Tricks rund ums Radfahrenstill warns on both .172 and .173. The .173isListingTargetchecks only the final segment against listing nouns, so a named Shopify blog index is indistinguishable from an article without additional page-purpose evidence. Please retain unrelated article-target controls and consider an evidence-based listing classification or an explicitly unconfirmed verdict for this case; do not exempt every/blogs/*descendant. Reproduction below includes the exact URL, a generic/articlescontrol and an unrelated target; same HTTP/offline/passive flags, 16 audited pages per version.