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
Jinja UndefinedError with header tags #142
Comments
Please provide the complete source of the page which is causing the issue (you can replace with lorem ipsum, though) and some information on versions. See the issue template for this reason. |
Version
index.md <h1 id="nr.pvrq2">nr.pvrq2</h1>
FooBar Baz mkdocs.yml site_name: My Docs
theme: material Error
|
I also just tried it with |
Actually I can not reproduce the |
Well, it has to do with the table of contents extension. The TOC cannot be generated when you use HTML tags, only when using the Markdown. The error shouldn't be there and there should be no TOC. Will fix it as soon as I find the time. EDIT: for now you can just use the standard Markdown Syntax and everything should be fine.
|
By the way, do you know why that is? Is it a limitation or design decision of MkDocs? I need to generate HTML tags to assign them correct IDs, and eventually additional styling (eg. parts of the header in a smaller font and/or in monospace). |
This is not a limitation of MkDocs, but of the Python Markdown Extensions MkDocs uses. Monospaced and smaller text is possible and supported by Material:
You could add your anchor as HTML in the header, though:
Untested, may break other stuff. |
I now know why it breaks - I had to apply a hack to check whether the content contains a <h1 class="" id="nr.pvrq2">nr.pvrq2</h1> I will provide a fix. |
Fix #144 is in |
Released in 1.0.4 |
Thanks, I can confirm it's working now! :) |
I get this error when I place a
<
or>
in a Markdown header, likeOr even when I juse HTML tags like
Error traceback:
The text was updated successfully, but these errors were encountered: