Skip to content

Commit

Permalink
Fixed issue with non-percent encoded anchors in table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Mar 19, 2023
1 parent 4ad2dc1 commit c3ba161
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
</script>
{% endblock %}
{% 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 %}
<script src="{{ path | url }}"></script>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/javascripts/components/toc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function watchTableOfContents(
/* Compute anchor-to-target mapping */
const anchors = getElements<HTMLAnchorElement>("[href^=\\#]", el)
for (const anchor of anchors) {
const id = anchor.hash.substring(1)
const id = decodeURIComponent(anchor.hash.substring(1))
const target = getOptionalElement(`[id="${id}"]`)
if (typeof target !== "undefined")
table.set(anchor, target)
Expand Down

0 comments on commit c3ba161

Please sign in to comment.