Skip to content

Commit

Permalink
Fix bug in speaker notes that broke navigating to next slide (#2634)
Browse files Browse the repository at this point in the history
Change this selector to use the ~= selector to test if a white space
separated word "prev" or "next" is contained

Fixes a speaker notes bug that did not allow going to the next slide in
the speaker notes.
The reason for that is that the "rel" attribute contained "prev"
respective "next prefetch".

See:
https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors#attrvalue_2

This fixes part of #2004 when going to the right (containing
"prefetch").
  • Loading branch information
michael-kerscher authored Feb 8, 2025
1 parent f9aca37 commit cdfe3e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion theme/speaker-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@

// Update prev/next buttons to keep speaker note state.
document
.querySelectorAll('a[rel="prev"], a[rel="next"]')
.querySelectorAll('a[rel~="prev"], a[rel~="next"]')
.forEach((elem) => {
elem.href += "#speaker-notes-open";
});
Expand Down

0 comments on commit cdfe3e7

Please sign in to comment.