Readable bookmark names for cross-reference targets in docx output
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
The issue asks for reports of workflows that depend on readable DOCX bookmark names, to judge whether Quarto should request a Pandoc fallback before hashing. Start by reviewing the examples in the issue: external links, hand-added Word cross-references, and post-processing with officer, VBA, or python-docx. Done means documenting a concrete use case in the issue; any implementation would need a separately scoped decision.
由索引模型根据 Issue 内容生成。
描述
Since Pandoc 3.12, the docx writer starts every bookmark name with _ and replaces any id containing a character other than a letter, digit or _ with a SHA-1 hash (jgm/pandoc@d171c5b, from jgm/pandoc#11845). Quarto 1.12 updates the bundled Pandoc to 3.13 (#15320).
All Quarto cross-reference ids contain - (fig-plot, tbl-cars, sec-intro), so every cross-reference target in a .docx is now a hidden bookmark with a name like _fba68d637b950dddd2fa839b49fee024d186089.
toBookmarkName :: Text -> Text
toBookmarkName s
| T.length s < 40
, T.all (\c -> isAlphaNum c || c == '_') s
= "_" <> s
| otherwise = "_" <> T.pack (drop 1 (show (hashWith SHA1 (fromText s))))
Cross-reference links inside the document still work, as link anchors are hashed the same way. What is lost is any reference to a target by its Quarto id from outside the document:
- a link like
report.docx#fig-plot - a Word cross-reference added by hand to a Quarto figure or table, which now requires showing hidden bookmarks and finding the right hash
- post-processing (
officer, VBA,python-docx) that looks a bookmark up by name
We decided to accept the Pandoc change for 1.12 and document it in the changelog. This issue is to collect use cases where the readable name matters. If you rely on one of the above, please describe your workflow here.
If there is demand, we could ask upstream for a readable fallback before hashing, for example fig-plot becoming _fig_plot, still hidden but recognisable. Hashing would remain for collisions or long ids.
Related: jgm/pandoc#6078 (Word cross-reference fields instead of hyperlinks in the docx writer)
- 主要语言
- 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
-
bug listings
难度 2/5 1-3 小时 新手友好度 72/100
quarto-dev/quarto-cli#15340 ·
维护者通常 1 天内回复
-
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 天内回复
查看 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 天内回复