Repository navigation
Description
I have
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
The category filter of a listing can disagree with the #category= hash in the URL.
applyListingHash in quarto-listing.js returns early when there is no hash, and it only filters when the category is not empty, so Back to the bare URL or to #category= never shows all items again.
Category names with &, = or % break after a reload or a shared link.
makeHash writes the name without encoding, parseHash splits on & and =, and the value is decoded twice: once in parseHash and again in applyListingHash.
So R&D is read as R, and 100% throws URIError: URI malformed in window["quarto-listing-loaded"], before pagination and progressive images are wired.
With #15339, item category tags become links, so a Ctrl or middle click on a tag opens such a URL in a new tab.
Related: #11752, #10829, #15339.
Steps to reproduce
_quarto.yml:
project:
type: website
website:
title: "Listing"index.qmd:
---
title: "Posts"
listing:
contents: posts
categories: true
---posts/one.qmd:
---
title: "Post one"
date: 2026-01-01
categories: [alpha, "R&D"]
---
Text.posts/two.qmd:
---
title: "Post two"
date: 2026-01-02
categories: [beta, "100%"]
---
Text.Render the website and open _site/index.html.
- Click "alpha" in the categories filter, then press Back.
- Click "R&D", then reload the page.
- Click "100%", then reload the page.
Actual behavior
- The URL has no hash, but the listing still shows one item and "alpha" is still active.
- The URL is
#category=R&D, the listing shows no items, and no entry is active. - The URL is
#category=100%, the console showsURIError: URI malformed, both items show, and no entry is active.
Expected behavior
- Back to the bare URL shows all items, with no category active ("All" is active in the numbered style).
- After a reload, the listing shows the one "R&D" item, and "R&D" is active.
- After a reload, the listing shows the one "100%" item, "100%" is active, and the console has no error.
Your environment
- Quarto built from
main(ac310a4). The listing script ismain'squarto-listing.js. - Browser: Brave (Chromium) on macOS 27.2.
Quarto check output
Quarto 99.9.9
[✓] Checking environment information...
Quarto cache location: /Users/mcanouil/Library/Caches/quarto
Project: none found (single-file mode)
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.107.1: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin
[✓] Checking basic markdown render....OK
Activity