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

Prevent left-flanking and right-flanking delimiter runs followed by multi-byte whitespace or punctuation characters #552

Closed
Witiko opened this issue Feb 17, 2025 · 0 comments · Fixed by #551
Assignees
Labels
Milestone

Comments

@Witiko
Copy link
Owner

Witiko commented Feb 17, 2025

The CommonMark 0.31.2 spec defines left-flanking and right-flanking delimiter runs as follows (emphasis mine):

A left-flanking delimiter run is a delimiter run that is (1) not followed by Unicode whitespace, and either (2a) not followed by a Unicode punctuation character, or (2b) followed by a Unicode punctuation character and preceded by Unicode whitespace or a Unicode punctuation character. For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.

A right-flanking delimiter run is a delimiter run that is (1) not preceded by Unicode whitespace, and either (2a) not preceded by a Unicode punctuation character, or (2b) preceded by a Unicode punctuation character and followed by Unicode whitespace or a Unicode punctuation character. For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.

As discussed with @lostenderman in #436 (comment) and below, we currently fail to correctly recognize following Unicode whitespace and punctuation characters whose UTF8-encoded representation is longer than one byte.

Requirements

  • Add a test file that reproduces the issue.
  • Fix the issue.
@Witiko Witiko added the bug label Feb 17, 2025
@Witiko Witiko added this to the 3.11.0 milestone Feb 17, 2025
@Witiko Witiko self-assigned this Feb 17, 2025
Witiko added a commit that referenced this issue Feb 17, 2025
Witiko added a commit that referenced this issue Feb 19, 2025
@Witiko Witiko linked a pull request Feb 19, 2025 that will close this issue
4 tasks
@Witiko Witiko mentioned this issue Feb 19, 2025
2 tasks
@Witiko Witiko closed this as completed in 902b6f9 Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant