Skip to content

Releases: spencermountain/out-of-character

Release list

2.3.0

Choose a tag to compare

@spencermountain spencermountain released this 14 Jul 22:28
ad58e85
  • [fix] replace() no longer leaves a lone surrogate behind when removing an astral character (kaithi, duployan, musical symbols)
  • [fix] require('out-of-character') works again — added a proper commonjs build (builds/out-of-character.cjs)
  • [fix] cli --remove actually removes, --recursive actually recurses (and no longer disables --replace)
  • [fix] narrow no-break space (U+202F) is replaced with a space, instead of being deleted
  • [new] detect bidirectional control characters (U+202A-U+202E, U+2066-U+2069) — the 'trojan source' attack
  • [new] detect tag characters (U+E0000-U+E007F) used for steganography, while preserving emoji tag-sequences like the england flag
  • [new] detect stray variation selectors (U+FE00-U+FE0F, U+180B-U+180F), while preserving emoji, keycap, cjk, and mongolian sequences
  • [new] detect interlinear annotation characters (U+FFF9-U+FFFB)
  • [new] detect() and replace() accept { exclude: ['Bidi', 'U+200B'] } to leave some characters alone
  • [new] results include a type field ('Invisible', 'Bidi', 'Tag', etc)
  • [fix] improved emoji handling using unicode property escapes — zero-width joiners next to non-emoji astral characters are now caught
  • [fix] richer typescript types, and a .d.cts for commonjs consumers
  • [change] sourcemaps are disabled for the umd build
  • [update] cleanup dependencies