Closed franckl closed 6 years ago
@facelessuser I'm sorry to ask, but do you have any ideas? It looks like an issue with the inline highlighting parser.
@franckl, as this doesn't seem to be reproducible by me, please provide markdown source that you are using to demonstrate the mentioned issue. Also, please provide things such as Python Markdown version, pymdown-extensions version, etc.
Ideally provide a minimal case (minimum required to reproduce).
@franckl, I reread, and I think I understand what is going on. Markdown is not supposed to be parsed inside block HTML.
Some block HTML is most likely not recognized the same way when it is indented under admonitions causing some inline code to be recognized.
In general, it isn't ideal to mix block HTML and Markdown, but there are options to allow you to mix them: https://python-markdown.github.io/extensions/extra/#simple-example. Keep in mind that sometimes the extra
solution can be a bit odd is some cases, and you will have to conform the HTML to how Markdown expects it; mainly removing indentation etc. Anyways, I'd play with the extra
option, or just use plain HTML inside HTML blocks.
In short, Markdown in inline tags are usually parsed, but not in block without an extension. Additionally, inline tags under block tags won't be parsed as the parser shouldn't usually traverse the content under the block tag unless it is for some reason treated as normal text by the parser. I'd have to look further to understand why your HTML under the admonition is being parsed. Maybe later today when I have time.
In general, I think block HTML is supposed to have an empty line before it per spec, though some parsers don't require this, but Python Markdown does. Most likely this is the cause of conflicting behavior.
One last note, if using pymdown-extensions, I'd use https://facelessuser.github.io/pymdown-extensions/extensions/extrarawhtml/ to parse in block HTML to avoid extension conflicts. It will share the same quirks as the previously mentioned solution, because it is essentially the same, but it splits it out from extra
to prevent pulling in incompatible extensions that might conflict with pymdown-extensions you may be using.
Closing as answered. Please re-open if you experience any further issues. Many thanks to @facelessuser!
Description
Inline code block (
example
) is not recognized when placed inside an html tableHowever, it does work when the table is placed inside a !!!tips (admonition). See screenshots below and code to reproduce.
I am using the latest python/pip/mkdocs/material versions on linux and osx with chrome.