Skip to content

Commit 1375b9c

Browse files
committed
Correctly compare item and current window location which is URI encoded
1 parent 7d809d7 commit 1375b9c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/resources/formats/html/quarto.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
238238
for (const listingPath of listingPaths) {
239239
const pathWithoutLeadingSlash = listingPath.listing.substring(1);
240240
for (const item of listingPath.items) {
241+
const encodedItem = encodeURI(item);
241242
if (
242-
item === currentPagePath ||
243-
item === currentPagePath + "index.html"
243+
encodedItem === currentPagePath ||
244+
encodedItem === currentPagePath + "index.html"
244245
) {
245246
// Resolve this path against the offset to be sure
246247
// we already are using the correct path to the listing

0 commit comments

Comments
 (0)