mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed annotations with nested lists not being mounted correctly
This commit is contained in:
parent
a8287eba1b
commit
3be797ece8
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>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.a51614de.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.b425cdc4.min.js' | url }}"></script>
|
||||
{% for path in config.extra_javascript %}
|
||||
{% if path.endswith(".mjs") %}
|
||||
<script type="module" src="{{ path | url }}"></script>
|
||||
|
@ -143,7 +143,7 @@ export function mountAnnotationList(
|
||||
const annotations = new Map<string, HTMLElement>()
|
||||
for (const marker of findAnnotationMarkers(container)) {
|
||||
const [, id] = marker.textContent!.match(/\((\d+)\)/)!
|
||||
if (getOptionalElement(`li:nth-child(${id})`, el)) {
|
||||
if (getOptionalElement(`:scope > li:nth-child(${id})`, el)) {
|
||||
annotations.set(id, renderAnnotation(id, prefix))
|
||||
marker.replaceWith(annotations.get(id)!)
|
||||
}
|
||||
@ -162,7 +162,7 @@ export function mountAnnotationList(
|
||||
for (const [id, annotation] of annotations)
|
||||
pairs.push([
|
||||
getElement(".md-typeset", annotation),
|
||||
getElement(`li:nth-child(${id})`, el)
|
||||
getElement(`:scope > li:nth-child(${id})`, el)
|
||||
])
|
||||
|
||||
/* Handle print mode - see https://bit.ly/3rgPdpt */
|
||||
|
Loading…
Reference in New Issue
Block a user