Description
I'm using the attr_list markdown extension to provide language neutral anchor's so I can define/reference each language section with the same anchor ids. This works great for the autogenerated TOC, the markdown links, images and more.
One thing that doesn't work is the autogenerated heading text (neither when specifying file, nor when using wildcard nav plugins, or when autoincluding the full doc dir).
It results in the following headings being generated in the sample provided below:
- in German doc
Hallo Welt { #introduction }
linking to the correct md/html file, should be justHallo Welt
- in English doc
Hello World { #introduction }
linking to the correct md/html file, should be justHello World
My suggestion would be to substitute the regexp-pattern \s*?\{.*?\}\s*?$
from the determined heading texts for the nav+page title if the attr_list plugin is enabled (or in general). This would exclude/remove all attributes from a heading (a more advanced version could maybe retain the attribute class etc, but not really needed).
I will see if i can submit a MR.
mkdocs.yml
docs_dir: docs/en
nav:
- somefile.md
markdown_extensions:
- attr_list
docs/en/somefile.md
# Hello World { #introduction }
Test
mkdocs.de.yml
docs_dir: docs/de
nav:
- somefile.md
markdown_extensions:
- attr_list
docs/de/somefile.md
# Hallo Welt { #introduction }
Test