Skip to content

Commit

Permalink
Fixed annotations with nested lists not being mounted correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Jun 23, 2023
1 parent a8287eb commit 3be797e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 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.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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)!)
}
Expand All @@ -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 */
Expand Down

0 comments on commit 3be797e

Please sign in to comment.