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

Fix incorrect emphasis span calculation. #829

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

snnz
Copy link
Contributor

@snnz snnz commented Dec 9, 2024

EmphasisInlineParser did not take into account the case of extra delimiter characters before the emphasis. For example:

**foo*

The supplied test produces the following result in the current version:

**foo*
```````````````````Result
paragraph    ( 0, 0)  0-5
literal      ( 0, 1)  1-1
emphasis     ( 0, 0)  0-5
literal      ( 0, 2)  2-4
```````````````````Expected
paragraph    ( 0, 0)  0-5
literal      ( 0, 0)  0-0
emphasis     ( 0, 1)  1-5
literal      ( 0, 2)  2-4

The emphasis intersects with the literal before it - obviously wrong. The effect of this can be seen in the Visual Studio editor: it displays the first asterisk as italics.

@xoofx xoofx merged commit 5ae8ab7 into xoofx:master Dec 17, 2024
1 check passed
@xoofx
Copy link
Owner

xoofx commented Dec 17, 2024

Thanks!

@xoofx xoofx added the bug label Dec 17, 2024
@snnz snnz deleted the fix-emphasis-span branch December 17, 2024 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants