Skip to main content

Module no_zero_width_chars

Module no_zero_width_chars 

Source
Expand description

no_zero_width_chars — flag invisible zero-width characters that can hide text, break identifiers, or leak data.

Codepoints flagged:

  • U+200B ZERO WIDTH SPACE
  • U+200C ZERO WIDTH NON-JOINER
  • U+200D ZERO WIDTH JOINER
  • U+FEFF ZERO WIDTH NO-BREAK SPACE (BOM) — but only when not at byte position 0. A leading BOM is no_bom’s territory; this rule stays focused on body-internal ZWs so the two rules don’t double-report.

Structs§

NoZeroWidthCharsRule

Functions§

build
is_flagged_zero_width
Returns true if c is a zero-width character that this rule flags. is_leading_feff == true means U+FEFF at byte 0 of the file (the BOM case) — that’s deliberately NOT flagged.