Readable bookmark names for cross-reference targets in docx output
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- documentation
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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)
- Vorherrschende Sprache
- JavaScript
- Sterne
- 6.2k
- Forks
- 482
- Ø Merge
- 17 Std. 46 Min.
- Gemergte PRs (30 T.)
- 135
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus quarto-dev/quarto-cli
-
Listing category filter and URL hash disagree after Back, or with `&`, `=` or `%` in a categoryOffenbug listings
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
quarto-dev/quarto-cli#15340 ·
Maintainer antworten meist innerhalb von 1 Tag
-
brand bug typst
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
quarto-dev/quarto-cli#15311 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Notebook preview header title takes the heading colour on the primary backgroundEvtl. vergeben @SabyaXSachi hat das vor 5 Tagen übernommen. Offenaccessibility bug embed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
quarto-dev/quarto-cli#15306 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bootstrap bug themes
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
quarto-dev/quarto-cli#15304 ·
Maintainer antworten meist innerhalb von 1 Tag
-
accessibility bug code-blocks html themes
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
quarto-dev/quarto-cli#15303 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in quarto-dev/quarto-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
0. Needs triage bug feature: api
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
agent-os ai bug good first issue help wanted
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
area: documentation good first issue package: rule-data status: accepting prs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
status: needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
mastra-ai/mastra#30109 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag