Skip to content

Commit d2db205

Browse files
authored
Fix selector for admonition title in togglebutton.js
When the toggleID contains symbols such as `:` an error occurs in JS and all dropdown admonitions after the current element stop functioning. The `CSS.escape` call fixes this.
1 parent ec20337 commit d2db205

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinx_togglebutton/_static/togglebutton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var initToggleItems = () => {
5050

5151
// Add click handlers for the button + admonition title (if admonition)
5252
admonitionTitle = document.querySelector(
53-
`#${toggleID} > .admonition-title`
53+
`#` + CSS.escape(toggleID) + ` > .admonition-title`
5454
);
5555
if (admonitionTitle) {
5656
// If an admonition, then make the whole title block clickable

0 commit comments

Comments
 (0)