Skip to content

Use Unicode punctuation in emphasis flanking rules#12

Open
PiotrCzapla wants to merge 1 commit into
mainfrom
claude/tst-strong-emphasis-b08c33
Open

Use Unicode punctuation in emphasis flanking rules#12
PiotrCzapla wants to merge 1 commit into
mainfrom
claude/tst-strong-emphasis-b08c33

Conversation

@PiotrCzapla

@PiotrCzapla PiotrCzapla commented Jul 10, 2026

Copy link
Copy Markdown

(“***{{company_common_name}}***”) rendered as literal asterisks instead of <em><strong>…</strong></em>.

We used is_ascii_punctuation() and the fancy quotation isn't matched by that function.
Classify a character as punctuation if it is ASCII punctuation or in the Unicode P general category (via the dependency-free unicode-properties crate)

One fable remark that seems interesting:

GFM 0.29 / CommonMark ≤0.30 define punctuation as ASCII + Unicode P. CommonMark 0.31 later widened this to P ∪ S; this PR intentionally sticks to P to match the spec version the conformance tests pin.

Should we bump the spect to 0.30?

delimiter_run_flags classified neighbours with is_ascii_punctuation, so
delimiter runs bounded by Unicode punctuation on one side and ASCII
punctuation on the other (e.g. curly quote outside, brace inside:
"***{{x}}***") failed the left/right-flanking checks and rendered as
literal asterisks. Classify punctuation as ASCII punctuation or Unicode
general category P, matching the spec's definition.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PiotrCzapla PiotrCzapla requested a review from jph00 July 10, 2026 22:23
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.

1 participant