printable-characters icon indicating copy to clipboard operation
printable-characters copied to clipboard

Include Mongolian Vowel Separator (U+180E) in zero-width character regex

Open Copilot opened this issue 4 months ago • 0 comments

Summary

This PR adds support for the Mongolian Vowel Separator (U+180E) as a zero-width character in the regex patterns used by the library.

Changes

Added \u180e to the zeroWidthCharacterExceptNewline constant in printable-characters.js. This ensures that U+180E is properly handled as an invisible character across all library functions.

Behavior

With this change, U+180E is now correctly treated as a zero-width character:

const { strlen, blank, isBlank } = require('printable-characters');

strlen('foo\u180ebar')    // Returns 6 (not 7)
strlen('foo\u180e')       // Returns 3 (same as strlen('foo'))
blank('foo\u180ebar')     // Returns '      ' (6 spaces)
isBlank('\u180e\u180e')   // Returns true

Testing

Added test cases to verify U+180E is handled correctly as a zero-width character. All existing tests continue to pass with 100% code coverage maintained.

Fixes the issue requesting inclusion of the Mongolian Vowel Separator in the zero-width character matching patterns.

Original prompt

This section details on the original issue you should resolve

<issue_title>Include Mongolian Vowel Separator (U+180E) in Regex</issue_title> <issue_description>Include the whitespace character U+180E in possible chars to match in the zeroWidthCharacterExceptNewline variable.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes xpl/printable-characters#3

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Oct 08 '25 20:10 Copilot