You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Colon in setext title (with '==' underline) causes incorrect page rendering #4079
I'm not sure how this should be fixed without breaking backward compatibility. It might be a good idea to make MultiMarkdown style meta-data an option that can be turned off - in our project we only use YAML style meta-data.
Workaround
All these variants will render correctly:
Atx-style headings:
# Foo: Bar
Lorem ipsum
A space in the text before the colon:
Foo bar: Baz
===
Lorem ipsum
YAML metadata before the title:
---workaround_mkdocs_colon_in_title: true # actual data doesn't matter, as long as it is valid YAML---
Foo: Bar
===
Lorem ipsum
If I understand, this is due to the meta extension in Python Markdown. It doesn't require explicit fences around key value pairs. So what happens is it sees:
key: value
If you put a blank line in front, it should render correctly, but MkDocs may be stripping that out. As a workaround, a comment before the header would allow it to work.
To be honest, maybe Python Markdown Meta extension should require key value pairs to be followed by a new line or the end of the buffer to prevent gobbling up setext headers. Or maybe it should just invalidate an entry if it is followed by ===, etc.
Additionally, maybe MkDocs should avoid stripping leading white space so people could just put a new line before the header to natural prevent this issue, but also, maybe Python Markdown.
Anyway, I think maybe creating an issue in Python Markdown might make sense. I think more could be done here to ensure sane results.
@facelessuser McDocs does not use the meta-data extension but has its own implementation, which @frankkusters properly linked to. The issue seems to be that his first header is being recognized as multimarkdown style metadata. As documented, that is the correct behavior. I'm now out-of-touch with what is going on with MkDocs, so I can't say how MkDocs wants to move forward on this, but at the time that I implemented the current solution, the answer would have been to insert a blank line before the header to avoid a false match. I did consider adding a config option so that the user could choose between the two styles, but ultimately decided against adding unnecessary options.
Today, multimarkdown has abandoned that old syntax and now supports YAML style. If I was implementing the feature today, I would either (1) only support YAML style or (2) provide the multimarkdown style as an option which can only be enabled by config option (I expect that I would be more likely to chose the first option). That said, MkDocs potentially has a large number of users relying on the current defaults, so it is not clear to me what the best way forward would be.
Activity
facelessuser commentedon Jan 26, 2026
If I understand, this is due to the
metaextension in Python Markdown. It doesn't require explicit fences around key value pairs. So what happens is it sees:If you put a blank line in front, it should render correctly, but MkDocs may be stripping that out. As a workaround, a comment before the header would allow it to work.
To be honest, maybe Python Markdown Meta extension should require key value pairs to be followed by a new line or the end of the buffer to prevent gobbling up setext headers. Or maybe it should just invalidate an entry if it is followed by
===, etc.Additionally, maybe MkDocs should avoid stripping leading white space so people could just put a new line before the header to natural prevent this issue, but also, maybe Python Markdown.
Anyway, I think maybe creating an issue in Python Markdown might make sense. I think more could be done here to ensure sane results.
facelessuser commentedon Jan 26, 2026
It seems you can have an explicit meta data empty container to prevent problems:
facelessuser commentedon Jan 26, 2026
I've created an issue over at Python Markdown. I have some ideas on how this could be improved.
waylan commentedon Jan 26, 2026
@facelessuser McDocs does not use the meta-data extension but has its own implementation, which @frankkusters properly linked to. The issue seems to be that his first header is being recognized as multimarkdown style metadata. As documented, that is the correct behavior. I'm now out-of-touch with what is going on with MkDocs, so I can't say how MkDocs wants to move forward on this, but at the time that I implemented the current solution, the answer would have been to insert a blank line before the header to avoid a false match. I did consider adding a config option so that the user could choose between the two styles, but ultimately decided against adding unnecessary options.
Today, multimarkdown has abandoned that old syntax and now supports YAML style. If I was implementing the feature today, I would either (1) only support YAML style or (2) provide the multimarkdown style as an option which can only be enabled by config option (I expect that I would be more likely to chose the first option). That said, MkDocs potentially has a large number of users relying on the current defaults, so it is not clear to me what the best way forward would be.