Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't trim non-ASCII whitespace #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tats-u
Copy link

@tats-u tats-u commented Sep 8, 2024

Fixes #261

.trim() removes non-ascii Unicode white spaces as well.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim

PS D:\cmark\out\install\x64-Debug\bin> .\cmark.exe
 全角スペース (U+3000) 全形空白 

 Em Space (U+2003) Em Space 

 NBSP (U+00A0) NBSP
^Z
<p> 全角スペース (U+3000) 全形空白 </p>
<p>?Em Space (U+2003) Em Space?</p>
<p>NBSP (U+00A0) NBSP</p>

cmark removes NBSP, but is this an expected behavior?
(? means U+2003 can't be converted to Shift_JIS, which is the OEM encoding in Japanese Windows.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

U+3000 ( ) is allowed as paragraph indentation
1 participant