Markdown in HTML blocks does not render after deployment (local normal) #8353
-
Problem DescriptionWhen testing with local <center>
[:material-rocket-launch: Quick Start](./download/installation/#download-latest-version){: .md-button .md-button--primary }
[:material-dots-horizontal-circle: Learn More](./about/project-overview/){: .md-button }
</center> <center>
<span style="font-size:1.6em;color:#ff6b6b">:material-heart-outline:</span>
<span style="font-size:1.4em;color:#ff8e8e">:material-heart-half-full:</span>
<span style="font-size:1.2em;color:#ffaaaa">:material-heart:</span>
Made with Love
<span style="font-size:1.2em;color:#ffaaaa">:material-heart:</span>
<span style="font-size:1.4em;color:#ff8e8e">:material-heart-half-full:</span>
<span style="font-size:1.6em;color:#ff6b6b">:material-heart-outline:</span>
</center> However, when deployed to GitHub Pages, these buttons appear as the original Markdown text instead of the rendered buttons. Confirmed to enable md_in_html extensions: markdown_extensions:
- md_in_html Related screenshots![]() ![]() ADDITIONAL INFORMATIONhttps://github.com/pyheight/ttk-file-explorer |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @pyheight,
Interesting, could you show the results of these commands? Maybe you have some special behaviour. Screenshots look like Windows 7, but I guess it's only a theme, right? 👀 python --version
pip freeze As for the fix, when you mix <center markdown>
<span style="font-size:1.6em;color:#ff6b6b">:material-heart-outline:</span> Also better keep the indent flat, as Python Markdown parser could see multiple spaces as a start of a quote or list. <center markdown>
<span style="font-size:1.6em;color:#ff6b6b">:material-heart-outline:</span> EDIT: Fixed the answer thanks to Isaac below 🫡 |
Beta Was this translation helpful? Give feedback.
-
@kamilkrzyskow, thank you very much for your professional guidance! Here is the environmental information and specific implementation you request: $ python --version
Python 3.8.0
$ pip freeze
Markdown==3.7
mkdocs==1.6.1
mkdocs-autorefs==1.2.0
mkdocs-get-deps==0.2.0
mkdocs-git-revision-date-plugin==0.3.2
mkdocs-material==9.6.15
mkdocs-material-extensions==1.3.1
mkdocs-mermaid2-plugin==1.2.1
mkdocs-static-i18n==1.3.0
mkdocstrings==0.26.1
mkdocstrings-python==1.11.1 As for the system environment, what you see is indeed Windows 7. Effect after repair: ![]() ![]() 🙏 Thank you again, your reply gave me a deeper understanding of the processing logic of the Markdown parser, especially the key point where container elements need to declare |
Beta Was this translation helpful? Give feedback.
Hi @pyheight,
Interesting, could you show the results of these commands? Maybe you have some special behaviour. Screenshots look like Windows 7, but I guess it's only a theme, right? 👀
As for the fix, when you mix
md_in_html
you have to addmarkdown
attribute to every [block-level] HTML tag in the DOM tree chain.Extension docs: https://python-markdown.github.io/extensions/md_in_html/#nesting
Example in the theme docs: https://squidfunk.github.io/mkdocs-material/reference/annotations/#in-everything-else