mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Allow ids for content tabs with special characters
This commit is contained in:
parent
940cfb27f1
commit
209856e724
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -216,7 +216,7 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.0238f547.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.382fbf4b.min.js' | url }}"></script>
|
||||
{% for path in config["extra_javascript"] %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endfor %}
|
||||
|
@ -84,11 +84,11 @@ export function watchContentTabs(
|
||||
const initial = inputs.find(input => input.checked) || inputs[0]
|
||||
return merge(...inputs.map(input => fromEvent(input, "change")
|
||||
.pipe(
|
||||
map(() => getElement<HTMLLabelElement>(`label[for=${input.id}]`))
|
||||
map(() => getElement<HTMLLabelElement>(`label[for="${input.id}"]`))
|
||||
)
|
||||
))
|
||||
.pipe(
|
||||
startWith(getElement<HTMLLabelElement>(`label[for=${initial.id}]`)),
|
||||
startWith(getElement<HTMLLabelElement>(`label[for="${initial.id}"]`)),
|
||||
map(active => ({ active }))
|
||||
)
|
||||
}
|
||||
@ -196,7 +196,7 @@ export function mountContentTabs(
|
||||
for (const input of getElements<HTMLInputElement>(
|
||||
":scope > input", set
|
||||
)) {
|
||||
const label = getElement(`label[for=${input.id}]`)
|
||||
const label = getElement(`label[for="${input.id}"]`)
|
||||
if (label.innerText.trim() === tab) {
|
||||
input.click()
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user