Repository navigation
perf: match Unicode punctuation with property escapes and leave uc.micro out of markdown-exit/core - #47
Open
onmax wants to merge 1 commit into
Open
perf: match Unicode punctuation with property escapes and leave uc.micro out of markdown-exit/core#47onmax wants to merge 1 commit into
onmax wants to merge 1 commit into
Conversation
…cro out of markdown-exit/core
Contributor
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
follow-up to #41. related: #45
markdown-exit imports uc.micro for one check:
isPunctChar, which asks whether a character is CommonMark's "Unicode punctuation", the P and S categories. uc.micro's regexes list every such character, so they're large and compress badly./[\p{P}\p{S}]/umatches the same set, and on Node 24 (Unicode 17) it gives the same answer as uc.micro for every code point.this switches
isPunctCharto that regex. uc.micro is still re-exported asmd.utils.lib.ucmicro, and it has to stay the real uc.micro, because plugins like markdown-it-abbr build non-uregexes fromucmicro.P.source. the default entry sets it on import, somarkdown-exitbehaves as before.markdown-exit/coreno longer imports it, and readingmd.utils.lib.ucmicrothere throws an error that says how to set it, the same waymd.linkifyworks since #41. the docs and a test cover both.markdown-exitmarkdown-exit/coreesbuild 0.28, minified ESM, gzip -9.
apps on
markdown-exit/corewith a plugin that readsmd.utils.lib.ucmicrowould need to set it. and on engines with older Unicode data,\p{}could miss punctuation added in newer Unicode versions. I only checked Node 24.