All rules

Invisible character

invisible-characteron by defaultJapanese / English

Characters that do not show on screen, such as a zero-width space

Example

Flagged
Send the form to the​ office.
What chaff prints
1:21 1 zero-width character (U+200B): search and copy break the word here
Fixed
Send the form to the office.
What chaff prints
no finding

How to fix

Delete the invisible character, and replace a no-break space with an ordinary space. An editor's "show invisibles" setting shows where they are.

Why it matters

A zero-width space, a byte order mark left mid-text, a soft hyphen, a direction mark and a control character stay in the text without showing on screen. They come in with text pasted from a web page or a PDF, and make a word that search does not find, a URL that does not open and a command that does not run. Direction marks and tag characters hidden after a letter can also make what a reader sees differ from what a machine reads, so they are a safety signal too. A no-break space after a heading or list marker stops the marker from working, and one next to Japanese text is left over from a paste. Code is checked too, since a copied command stops working. A joiner inside an emoji or in Arabic or Indic script, a direction mark or isolate next to right-to-left text, the tag characters of a regional flag and a single variation selector after a character are part of the writing and are not counted. A direction override (LRO, RLO) is always reported.

What it does not flag

A joiner inside an emoji or in Arabic or Indic script, a direction mark next to right-to-left text, the tag characters of a regional flag, a single variation selector after a character, a byte order mark at the start of the file and a no-break space between English words are not reported.

Turning it off or relaxing it

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

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

Invisible character ({code})

{count} zero-width characters ({code}): search and copy break the word here

{count} soft hyphens ({code}): search breaks the word here

{count} direction marks ({code}): the order a reader sees can differ from the order a machine reads

{count} control characters ({code})

{count} hidden tags ({code}) after a character: they can carry text a reader cannot see

A no-break space ({code}) where an ordinary space belongs

This page is built from the rule's definition file:packages/chaff/rules/invisible-character.yaml