Listing category filter and URL hash disagree after Back, or with `&`, `=` or `%` in a category
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- frontend
调研方向
从 quarto-listing.js 开始,重点查看 applyListingHash、makeHash 和 parseHash,然后使用提供的类别名称,在渲染后的列表中复现这三个情况。检查返回原始 URL 时筛选器如何重置,以及编码后的类别名称如何在重新加载后保留。完成标准是:在原始 URL 下,所有条目都出现且没有选中任何类别;每个含特殊字符的类别都能选中并显示对应条目,且控制台没有错误。
由索引模型根据 Issue 内容生成。
描述
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(ac310a424). 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
- 主要语言
- JavaScript
- 星标
- 6.2k
- 派生
- 482
- 平均合并
- 17 小时 46 分钟
- 30 天内合并 PR
- 135
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto-cli 的其他 Issue
-
brand bug typst
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto-cli#15311 ·
维护者通常 1 天内回复
-
Notebook preview header title takes the heading colour on the primary background可能已有人在做 @SabyaXSachi 于 5 天前认领。 未关闭accessibility bug embed
难度 2/5 1-3 小时 新手友好度 85/100
quarto-dev/quarto-cli#15306 · 1 条评论 ·
维护者通常 1 天内回复
-
bootstrap bug themes
难度 2/5 1-3 小时 新手友好度 82/100
quarto-dev/quarto-cli#15304 ·
维护者通常 1 天内回复
-
accessibility bug code-blocks html themes
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto-cli#15303 ·
维护者通常 1 天内回复
-
accessibility brand bug dark-mode
难度 2/5 1-3 小时 新手友好度 82/100
quarto-dev/quarto-cli#15301 ·
维护者通常 1 天内回复
查看 quarto-dev/quarto-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
0. Needs triage bug feature: api
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
agent-os ai bug good first issue help wanted
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
area: documentation good first issue package: rule-data status: accepting prs
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
status: needs triage
难度 2/5 1-3 小时 新手友好度 85/100
mastra-ai/mastra#30109 · 2 条评论 ·
维护者通常 1 天内回复