All rules

Link text shows one address, the link goes to another

link-text-url-mismatchon by defaultJapanese / English

A link whose text is a URL on one site and whose target is on another

Example

Flagged
The new guide is at [https://docs.example.com/guide](https://old.example.net/guide) now.
What chaff prints
1:21 The link text shows "docs.example.com" but the link goes to "old.example.net"
Fixed
The new guide is at [https://docs.example.com/guide](https://docs.example.com/guide) now.
What chaff prints
no finding

How to fix

Check which of the two is right and make the other match. Naming the target in words ("[the setup guide](https://…)") avoids the mismatch altogether.

Why it matters

A link whose text is an address ("[https://example.com/guide](https://other.example/page)") that names a different site from where the link goes. The reader clicks expecting the address they see and lands somewhere else. It is usually what is left when a URL was changed in one place only, and it is also the shape phishing uses. On the same site (host), a path the target does not start with ("[github.com/acme/handbook](https://github.com/handbook)") is another page, and is reported.

What it does not flag

A shortened display of an address on the same site ("[github.com/a](https://github.com/a/b)", or one cut with "…"), link text that is not an address, relative or in-page targets, and reference-style links ("[text][1]") are not reported. "www." and letter case are ignored.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: link-text-url-mismatch — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax link-text-url-mismatch --why "reason"
Turn it off for the team (chaff.yaml)
rules: link-text-url-mismatch: off
Technical details
Layer
L1
Status
stable
Severity
warning
Languages
Japanese and English
Suited to
business, technical, blog, legal, docs, academic, literature, speech
Reads from the document
markdown

Levels

Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).

stricterror
normalwarning
relaxedinfo

This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.

By genre

Runs by default in
technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript

Genres

Message

The link text shows "{shown}" but the link goes to "{target}"

Rewrite depth (chaff fix-plan --depth): light — words and sentences; the structure and the voice stay

This page is built from the rule's definition file:packages/chaff/rules/link-text-url-mismatch.yaml