Fixed Unicode slugifier breaking table of contents blur on scroll

This commit is contained in:
squidfunk 2019-01-28 09:48:05 +01:00
parent 226a248be6
commit ee0371d026
5 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,7 @@
mkdocs-material-3.x.x (2019-xx-xx)
* Fixed #972: Unicode slugifier breaks table of contents blur on scroll
mkdocs-material-3.2.0 (2018-12-28)
* Added support for redirects using metadata refresh

View File

@ -66,7 +66,7 @@
{% endif %}
{% endblock %}
{% block libs %}
<script src="{{ 'assets/javascripts/modernizr.8c900955.js' | url }}"></script>
<script src="{{ 'assets/javascripts/modernizr.962652e9.js' | url }}"></script>
{% endblock %}
{% block fonts %}
{% if font != false %}
@ -185,7 +185,7 @@
{% endblock %}
</div>
{% block scripts %}
<script src="{{ 'assets/javascripts/application.b3a2063f.js' | url }}"></script>
<script src="{{ 'assets/javascripts/application.05988d62.js' | url }}"></script>
{% if lang.t("search.language") != "en" %}
{% set languages = lang.t("search.language").split(",") %}
{% if languages | length and languages[0] != "" %}

View File

@ -53,8 +53,9 @@ export default class Blur {
/* Index anchor node offsets for fast lookup */
this.anchors_ = [].reduce.call(this.els_, (anchors, el) => {
const hash = decodeURIComponent(el.hash)
return anchors.concat(
document.getElementById(el.hash.substring(1)) || [])
document.getElementById(hash.substring(1)) || [])
}, [])
}