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

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

tats-u
Copy link
Contributor

@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.)

@jgm jgm merged commit f3145e8 into commonmark:master Sep 23, 2024
6 checks passed
@tats-u tats-u deleted the trim-only-ascii-space branch September 23, 2024 22:35
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
2 participants