mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed issue with non-percent encoded anchors in table of contents
This commit is contained in:
parent
4ad2dc1e28
commit
c3ba161233
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -240,7 +240,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.efa0ade1.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.8bbcded3.min.js' | url }}"></script>
|
||||||
{% for path in config.extra_javascript %}
|
{% for path in config.extra_javascript %}
|
||||||
<script src="{{ path | url }}"></script>
|
<script src="{{ path | url }}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -134,7 +134,7 @@ export function watchTableOfContents(
|
|||||||
/* Compute anchor-to-target mapping */
|
/* Compute anchor-to-target mapping */
|
||||||
const anchors = getElements<HTMLAnchorElement>("[href^=\\#]", el)
|
const anchors = getElements<HTMLAnchorElement>("[href^=\\#]", el)
|
||||||
for (const anchor of anchors) {
|
for (const anchor of anchors) {
|
||||||
const id = anchor.hash.substring(1)
|
const id = decodeURIComponent(anchor.hash.substring(1))
|
||||||
const target = getOptionalElement(`[id="${id}"]`)
|
const target = getOptionalElement(`[id="${id}"]`)
|
||||||
if (typeof target !== "undefined")
|
if (typeof target !== "undefined")
|
||||||
table.set(anchor, target)
|
table.set(anchor, target)
|
||||||
|
Loading…
Reference in New Issue
Block a user