Closed j123b567 closed 3 years ago
Does it correctly support diacriticals in headings?
Does it correctly support diacriticals in headings?
I think reading the following issue can answer your question. https://github.com/squidfunk/mkdocs-material/issues/8
I actually meant headings, not filenames. I have experienced some issues with href links not working when headings had diacriticals in them. This probably might not apply to pdf links
Could you provide an example so I can test and confirm your issue is fixed by this or create a new one?
Now I remember what the issue was. It was caused, I think, by mkdocs itself. When you had heading on a page with diacritics, the element id (used for hash navigation) skipped diacritical letters (heading "Červená máňa" had id "erven-ma") which was very impractical. We resorted to using uslugify, which stripped only diacriticals, not whole letters. You can probably take my comments just as a "reminder" to test tolerance to unicode characters
@trogper noted, I'm planning to have a test forlder to test particular behavior such the one you have reported. Thanks.
Generating links and appropriate ids was overcomplicated witch results in multiple unhandled edge cases. File name extensions were removed, relative paths were not properly handled in all cases, etc. So it sometimes breaks linking between documents.
This PR just simplify all things and remove unnecesery URL manupulations. It generates unique and consitant ids and hrefs.
It works well with both
use_directory_urls: False
and alsouse_directory_urls: True
.It generates same ids and hrefs in all cases, where original implementation works, and correct ids and hrefs in all other cases, where original implementation fails. One exception is just that with
use_directory_urls: False
urls and ids now also contains file name extensions, which just works. There is no need to remove them.This also leads to not breaking external URLs.