Skip to content

Commit 4f331be

Browse files
fix: Filter out headings inside dialogs for toc highlighting (#792)
Headline highlighting was broken for headlines with dialogs. <img width="2720" height="1394" alt="image" src="https://github.com/user-attachments/assets/99981148-403d-4c77-af6c-82654eaeb457" /> Co-authored-by: Robert Schuster <77234379+therobrob@users.noreply.github.com>
1 parent e54dec9 commit 4f331be

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

assets/js/highlightHeadline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function initHighlightHeadline() {
22
const headings = Array.from(
33
document.querySelectorAll(".o-single__highlight :is(h1, h2, h3)"),
4-
);
4+
).filter((heading) => !heading.closest("dialog"));
55
const windowPath = window.location.pathname;
66
if (headings.length === 0) {
77
return;

0 commit comments

Comments
 (0)