Skip to content

Don't trim non-ASCII whitespaces#1074

Merged
puzrin merged 4 commits into
markdown-it:masterfrom
tats-u:no-trim-unicode
May 20, 2026
Merged

Don't trim non-ASCII whitespaces#1074
puzrin merged 4 commits into
markdown-it:masterfrom
tats-u:no-trim-unicode

Conversation

@tats-u

@tats-u tats-u commented Dec 15, 2024

Copy link
Copy Markdown
Contributor

Fixes #1067

@tats-u

tats-u commented Jan 26, 2025

Copy link
Copy Markdown
Contributor Author

If you will not review this PR, I will publish a new markdown-it plugin package only to deal with this issue.

@tats-u

tats-u commented Dec 14, 2025

Copy link
Copy Markdown
Contributor Author

@puzrin

puzrin commented May 19, 2026

Copy link
Copy Markdown
Member

I think asciiTrim name will be more comprehensive. Ok to merge. Please add clarifications in #1067

@puzrin

puzrin commented May 20, 2026

Copy link
Copy Markdown
Member

Note. The same issue as in another PR. Function (isSpaceLike) should NOT be placed into another one for performance reasons.

Possible name ~ isAsciiTrimmable. After one month, everyone will forget about this PR, what isSpaceLike means, and why it exists at all. It's good when anyone can understand code immediately, without thinking. Probably, an additional comment will help.

Light trim for blocks like paragraph/header, where simple whitespaces should be trimmed, but unicode ones should stay intact.

@tats-u

tats-u commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Renamed based on your suggestion.

@puzrin puzrin merged commit fc37424 into markdown-it:master May 20, 2026
1 check passed
@tats-u tats-u deleted the no-trim-unicode branch May 20, 2026 15:15
puzrin added a commit that referenced this pull request May 21, 2026
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.

Don't trim non-ASCII whitespaces

2 participants