-
Notifications
You must be signed in to change notification settings - Fork 869
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
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. |
Is this bug fixed in 3+ version? I cann't render reference links in node.js documentation Example: |
@bndby if you read my previous comments closely you will see that we don't really consider this to be a bug as the current behavior matches the reference implementation. That said, we are not opposed to applying a fix if someone wants to take the time to developed one. However, I have no need for a fix and am not interested in spending the time to work on one. Therefore, I don't expect this to ever be fixed. |
Reference Links with Formatting Test
An inline link can contain various
Markdown
formatting.A reference link works when you don't have any formatting.
A reference link with formatting also renders properly.
If that formatting contains
code
backticks then it should, but the Python renderer doesn't handle it correctly.Source:
Output of
python -m markdown
with 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: