-
Notifications
You must be signed in to change notification settings - Fork 431
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
footnote in triple tick not being escaped #172
Comments
Taking a look further, it looks like something isn't parsed right, because the top one doesn't work, and the bottom one does: |
I believe I can confirm an issue, but there are some conditions that affect it. (tl,dr: something is wrong with the example but also wrong with the code, and I share my findings but want someone to tell me if I'm overlooking anything. I might have time to contribute a PR.) with fenced-code-blocks onFenced code blocks which are indented sufficiently ("tab width") are treated as code because they are indented (including fences), not because of the triple backticks (which become quoted content). In your paste example, the first block is indented 2 spaces, which by default is less than the "tab width" number of spaces (4), so the indentation is not considered to be significant and therefore normal paragraphs are formed. This might be considered normal. However, the same block, when indented by 4 spaces, becomes a code block due to indentation and the backticks are treated as part of the quoted matter. See example gist for 2-space and 4-space comparison. https://gist.github.com/devvynm/4ff8b3e0dc9bad60ca4b#file-python-markdown-extras-issue-demo-py indented interior of fenced block vs everything flush leftI also tested indenting the contents of the fenced code block without indenting the backtick fences, and found that made a difference: if interior lines are indented, contents are not parsed; if flush with line start, footnotes are parsed even though the fences still triggered the code and pre tags to be rendered (probably not expected). fenced-code-blocks offThe bottom of the output from running the above gist also shows the footnote not getting parsed from a properly indented code block (4 spaces, the default tab width) when the fenced-code-blocks extra is disabled. However, without researching more I'm not sure whether indented blocks (whether being wrapped in |
I'm in the process of making an API using this utility, and I'm running into issues generating help for the footnote extra. It looks like when you have the footnote extra added, adding
This is a paragraph with a footnote. 1
inside ```'s, it's executing itself as a footnote, rather than escaping and showing the pre tags or whatever.
tl;dr: footnotes should be escaped when using triple ticks.
Footnotes
This is the text of the note. ↩
The text was updated successfully, but these errors were encountered: