Skip to content

Commit 3be797e

Browse files
committed
Fixed annotations with nested lists not being mounted correctly
1 parent a8287eb commit 3be797e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

material/assets/javascripts/bundle.a51614de.min.js renamed to material/assets/javascripts/bundle.b425cdc4.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/javascripts/bundle.a51614de.min.js.map renamed to material/assets/javascripts/bundle.b425cdc4.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
</script>
241241
{% endblock %}
242242
{% block scripts %}
243-
<script src="{{ 'assets/javascripts/bundle.a51614de.min.js' | url }}"></script>
243+
<script src="{{ 'assets/javascripts/bundle.b425cdc4.min.js' | url }}"></script>
244244
{% for path in config.extra_javascript %}
245245
{% if path.endswith(".mjs") %}
246246
<script type="module" src="{{ path | url }}"></script>

src/assets/javascripts/components/content/annotation/list/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function mountAnnotationList(
143143
const annotations = new Map<string, HTMLElement>()
144144
for (const marker of findAnnotationMarkers(container)) {
145145
const [, id] = marker.textContent!.match(/\((\d+)\)/)!
146-
if (getOptionalElement(`li:nth-child(${id})`, el)) {
146+
if (getOptionalElement(`:scope > li:nth-child(${id})`, el)) {
147147
annotations.set(id, renderAnnotation(id, prefix))
148148
marker.replaceWith(annotations.get(id)!)
149149
}
@@ -162,7 +162,7 @@ export function mountAnnotationList(
162162
for (const [id, annotation] of annotations)
163163
pairs.push([
164164
getElement(".md-typeset", annotation),
165-
getElement(`li:nth-child(${id})`, el)
165+
getElement(`:scope > li:nth-child(${id})`, el)
166166
])
167167

168168
/* Handle print mode - see https://bit.ly/3rgPdpt */

0 commit comments

Comments
 (0)