Skip to content

Use original run lengths to judge multiples of three#730

Merged
Martin1887 merged 2 commits intopulldown-cmark:masterfrom
notriddle:notriddle/emphasis-matching
Oct 19, 2023
Merged

Use original run lengths to judge multiples of three#730
Martin1887 merged 2 commits intopulldown-cmark:masterfrom
notriddle:notriddle/emphasis-matching

Conversation

@notriddle
Copy link
Collaborator

@notriddle notriddle commented Oct 13, 2023

Fixes #729

The phrase that the specification uses is:

If one of the delimiters can both open and close emphasis, then the sum of the lengths of the delimiter runs containing the opening and closing delimiters must not be a multiple of 3 unless both lengths are multiples of 3.

Pulldown-cmark considered a run to be split, and its size reduced, when it participated in an emphasis span, but other implementations seem to use the original length of the emphasis span to judge this rule.

The phrase that the specification uses is:

> If one of the delimiters can both open and close emphasis, then
> the sum of the lengths of the delimiter runs containing the opening
> and closing delimiters must not be a multiple of 3 unless both
> lengths are multiples of 3.

Pulldown-cmark considered a run to be split, and its size reduced,
when it participated in an emphasis span, but other implementations
seem to use the *original* length of the emphasis span to judge
this rule.
@notriddle notriddle force-pushed the notriddle/emphasis-matching branch from a6f21e0 to 62449cb Compare October 14, 2023 00:01
@Martin1887
Copy link
Collaborator

Cool, thanks!

@Martin1887 Martin1887 merged commit d35772d into pulldown-cmark:master Oct 19, 2023
@notriddle notriddle deleted the notriddle/emphasis-matching branch October 19, 2023 15:51
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.

[fuzz result] incorrect delimiter matching with long run lengths

2 participants