Repository navigation
Add symbols to unicode punctuation - #739
Merged
Merged
Conversation
The current commonmark definition of “ASCII punctuation character” does not only include the unicode punctuation characters within the ASCII range, but also the unicode symbol characters within the ASCII range: `$`, `+`, `<`, `=`, `>`, `^`, `` ` ``, `|`, `~`. I think this makes sense. I think that users would not know the difference, and would indeed expect to be able to escape `*` the same as `$`. I think it is also sensical to broaden the definition of unicode punctuation the same way, so that there’s no difference between `$`, `£`, and `€`. Currently: ```markdown *$*a. *£*a. *€*a. ``` *$*a. *£*a. *€*a. Proposed: both do not turn into `<em>`s (note this is not a useful example, I am sure it could be possible to come up with a better one). > Note, `S` (symbol) includes the subgroups: > > ``` > gc ; Sc ; Currency_Symbol > gc ; Sk ; Modifier_Symbol > gc ; Sm ; Math_Symbol > gc ; So ; Other_Symbol > ```
wooorm
added a commit
to micromark/micromark
that referenced
this pull request
Jun 26, 2023
When considering whether attention (emphasis, strong) will work, CommonMark currently treats ASCII symbols (such as `$`) and Unicode symbols (such as `£`) differently. This matches that. See also: commonmark/commonmark-spec#739.
Member
|
I'm in favor of this change -- does anyone see a problem with it? |
Contributor
|
This needs an example in the spec, otherwise parsers that use spec as compliance tests might miss the change. |
Contributor
Author
|
added a test case! |
wooorm
commented
Aug 9, 2023
| ```````````````````````````````` | ||
|
|
||
|
|
||
| Unicode symbols count as punctuation, too: |
Contributor
Author
There was a problem hiding this comment.
the position of the case and this line are due to the test before it, which reads “Unicode nonbreaking spaces count as whitespace, too:”
wooorm
added a commit
to micromark/micromark
that referenced
this pull request
Jan 28, 2024
This only really adds Unicode symbols to where Unicode punctuation also works. Which is only affecting whether emphasis/strong “forms” or not. Which basically means that `*$*` now works the same as `*€*`. See commonmark/commonmark-spec#739.
This was referenced Sep 23, 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.
The current commonmark definition of “ASCII punctuation character” does not only include the unicode punctuation characters within the ASCII range, but also the unicode symbol characters within the ASCII range:
$,+,<,=,>,^,`,|,~.I think this makes sense. I think that users would not know the difference, and would indeed expect to be able to escape
*the same as$.I think it is also sensical to broaden the definition of unicode punctuation the same way, so that there’s no difference between
$,£, and€.Currently:
*$*a.
£a.
€a.
(EDIT: if GH supports this PR, the emphasis does not work in the above 3 cases, when it doesn’t, emphasis works for
£and€but not for$)Proposed: none turn into
<em>s (note this is not a useful example, I am sure it could be possible to come up with a better one).