mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-10 14:00:05 +00:00
Bold Text inside of a word with trailing punctuation character inside of bold is not rendered #582
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RickStrahl on GitHub (Dec 8, 2022).
There's a rendering issue with bold text when bold is selected without a trailing space after teh bold text (ie. inside of a word boundary) and the bold text ends in a puntuation or sign character.
Here's that rendered on GitHub which exhibts the same behavior actually:
GOOD: bold text ending with slash/ followed by non-blank
BAD: **bold text ending with slash/**followed by non-blank
BAD: **bold text ending with slash=**followed by non-blank
GOOD: bold text ending with slash/followed by non-blank
I've tried escaping the text with
\and none of that seems to help. The only workaround seems to be using raw HTML as long as the target parser supports that (and MarkDig and Github appear to both).The following Babelmark demonstrates - although it behaves differently yet (even for MarkDig and GitHub which obviously behave slightly differently):
Babelmark for bold issue
(hmmm... babelmark seems to inject an extra space regardless, but GitHub here or MarkDig seem to do the right thing)
This is an edge case for sure, so probably low priority and apparently MarkDig isn't the only parser handling it this way. Not sure if this even should be fixed because it would give different behavior than GitHub which is the most common use case for Markdown to end up on.
Anybody know why the
/**moreTextwould cause this behavior in the parser?@MihaZupan commented on GitHub (Dec 8, 2022):
This behavior comes from CommonMark's right-flanking delimiter run definition:
Specifically,
**bold with slash/**fdoesn't match either of the 2a/2b conditions as the closing**are preceded by punctuation (/) but not followed by a whitespace/punctuation.Examples 391 and 392 represent this case.
@RickStrahl commented on GitHub (Dec 9, 2022):
Thanks for the pointer Miha...
So I don't see that there's any workaround short of using raw HTML
Is there any other way that this can be bypassed? Looks like escaping doesn't work.
@xoofx commented on GitHub (Dec 9, 2022):
Don't think that there is any workaround than to use raw HTML.