Readable bookmark names for cross-reference targets in docx output
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 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分
- マージ済み PR(30日)
- 135
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
Listing category filter and URL hash disagree after Back, or with `&`, `=` or `%` in a categoryオープン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 日以内に返信