Repository navigation
nbsp: do not insert before the semicolon that ends a character reference - #3
Merged
Merged
Conversation
polytypo/polytypo#22, spec 1.3.0 (nbsp.md 3.3 step 4). text mode has no markup concept, so fr -- whose narrowBeforePunctuation lists ";" -- inserted U+202F before the ";" that ends a reference: 'Bonjour : oui' and 'Tom & Jerry' stopped being what they were. Only locales that put a space before ";" could reach it, so the defect was invisible in English. N1/N2 now walk left from a ";" over ASCII alphanumerics, optionally one "#", and decline if an "&" closes the walk. Shape, not the named-reference table: declining on '¬aname;' costs nothing, and no runtime carries thousands of entries for it. The walk is bounded at 32, one past the longest named reference. Five tests, two pinning what the guard does not do. Locally 1126 tests pass; the markdown-mode cases and the packaging tests need dependencies this machine does not have and are left to CI. All 1073 canonical fixtures that run here pass with spec 1.3.0 locale data generated in, each idempotent.
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.
Implements spec 1.3.0's
nbsp.md§3.3 step 4 (polytypo/polytypo@aaa1b90, canonical issue #22). The same change landed in polytypo-js#12.textmode has no markup concept, sofr— whosenarrowBeforePunctuationlists;— inserted U+202F before the;that ends a character reference, and the reference stopped being one:Bonjour : ouiBonjour + U+202F +: ouiTom & JerryTom &+ U+202F +JerryOui ; nonOui+ U+202F +; non;The guard
Walk left from the
;over ASCII alphanumerics, optionally one#, and decline if an&closes the walk. Shape, not the HTML named-reference table: that table is thousands of entries which five runtimes would have to carry identically, and declining on¬aname;costs nothing. The walk is bounded at 32 code points, one past the longest named reference.Verification
tree_sitter_markdownand the packaging tests need a build toolchain, neither of which this machine has — those are left to CI.The vendored spec copy is untouched; it refreshes in the 1.3.0 release round.