mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed table of contents following not working for percent-encoded URIs
This commit is contained in:
parent
19fb69e379
commit
64ca8fefd4
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.b78d2936.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.fc8c2696.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 = decodeURIComponent(anchor.hash.substring(1))
|
const id = 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