Comments (5)
Oops, yes, there was another error related to the refactoring. I opened a PR which fixes the problem for the reproduction #3694, but it might still be necessary to change the slugify function to something else.
from mkdocs.
Thank you, I was able to confirm the issue. I've edited the title accordingly.
It's possibly related to the changes made in #3649. @squidfunk could you take a look?
from mkdocs.
Here's a small repro. Extract it, create a venv, install mkdocs, serve, and observe behavior by clicking on the Section 3 dropdown.
from mkdocs.
Here's what's happening: the slugify function that is used by toc.slugify
seems to filter all characters out (as it only seems to keep ASCII), resulting in an ""
(empty string) anchor. This leads to the following invalid selector:
<a href="#" class="dropdown-item">Section 3</a>
This selector is passed to document.querySelector
which says that an empty value for an anchor is not valid. Solution: choose another slugify
function. Here's what we recommend to the users of Material for MkDocs:
markdown_extensions:
- toc:
slugify: !!python/object/apply:pymdownx.slugs.slugify
kwds:
case: lower
Note that this requires to pip install pymdown-extensions
. Sorry for linking to our documentation, MkDocs own documentation does not seem to have a section (yet?) on configuring slugification for non-Latin languages correctly.
from mkdocs.
@tomchristie do you have any plans when the fix will be released, e.g., as part of bugfix release like 1.6.1? The reported issue is hitting all users that use the default mkdocs
theme and have at least one 3rd level section.
from mkdocs.
Related Issues (20)
- plugin autorefs installed but not found HOT 1
- Organizing chapters on toolbar using mkdocs
- Anchor validation false positives after upgrading to 1.6 HOT 1
- Substring search does not work
- Improve performance and authoring experience of `mkdocs serve` HOT 14
- Emit INFO instead of WARNING for Deprecated options HOT 5
- Break search plugin out into separate package HOT 8
- Empty mkdocs_theme.yml breaks build
- Generate nav with links to headers HOT 1
- ModuleNotFoundError: No module named 'mkdocs.tests' HOT 1
- FR: Anchor validation warning should remind the user it's case sensitive, especially if there are case-insensitive matches. HOT 3
- Anchor validation and special characters. HOT 2
- How to specify the port in MkDocs HOT 1
- AttributeError: 'EntryPoints' object has no attribute 'get' in xarray.backends HOT 1
- Should the markdown renderer treat a single line break as <br>? HOT 2
- Feature Request: Extend the `on_page_context` event with the reference to the Jinja2 Environment HOT 1
- Mkdocs no longer respecting set display text for same .md files. HOT 3
- Cannot get mkdocs to recognize the caseinsensitive plugin HOT 1
- Table display “flickers” when refreshing the page HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs.