-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Marked version:
16.3.0
Describe the bug
Possibly related to #1663?
There are some weird edge cases around backtick parsing. Take the following string:
**You might think this should be bold, but it should actually be regular text because codespans have higher priority: ``**``
This should turn the closing **
into a codespan, but it doesn't. Weirdly enough, it will work when the backtick strings have an odd number of backticks, eg. 1 or 3, but will flip back to not working for any even number of backticks.
To Reproduce
Steps to reproduce the behavior:
I have also observed this behavior with link parsing. The following string parses correctly in CommonMark but not in Marked:
[this``should be parsed as text/codespan/text](https://github``.com)
It exhibits the same "okay with an odd number, not okay with an even number" behavior.
Expected behavior
Given the precedence codespan markers have over everything inline other than autolinks and HTML, these should parse as text and codespan elements, not text/strong or link.