Reference links don't work if the link label contains backticks #495
Comments
|
Interestingly, the oldest implementations (the reference implementation and those which most closely follow it) all behave the same way. I'm comfortable being in that company. Personally, I never use code spans in my references (I number them). Regardless, this is a potentially surprising behavior and could reasonably be considered a bug. However, the current implementation is highly dependent on the order in which regexs are run against the source text (as is the reference implementation). The only reason Markdown text inside a code span isn't parsed is because the regex to match the code span is run first. Therefore, the link no longer contains a code span (as Markdown formatted text) by the time the reference link code is run and the link label doesn't match a known reference key. The only way to fix this is to completely refactor the entirety of the inline processing code. It just so happens that I have started some work on that for version 3.0. Until then, this will have to stay as-is, which I'm okay with for the reasons mentioned above. |
Reference Links with Formatting Test
An inline link can contain various
Markdownformatting.A reference link works when you don't have any formatting.
A reference link with formatting also renders properly.
If that formatting contains
codebackticks then it should, but the Python renderer doesn't handle it correctly.Source:
Output of
python -m markdownwith Markdown 2.6.2 module (verified with Python 2.7.12 and Python 3.5.2 both on Linux):As you can see, in the Python output, it retains the [brackets around link label][] in the output HTML.
The text was updated successfully, but these errors were encountered: