Readable bookmark names for cross-reference targets in docx output
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- Active
- Stack technique
- javascript
- Domaine
- documentation
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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)
- Langage dominant
- JavaScript
- Étoiles
- 6.2k
- Forks
- 482
- Merge moyen
- 17 h 46 min
- PR mergées (30 j)
- 135
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de quarto-dev/quarto-cli
-
Listing category filter and URL hash disagree after Back, or with `&`, `=` or `%` in a categoryOuvertebug listings
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
quarto-dev/quarto-cli#15340 ·
Les mainteneurs répondent en général sous 1 jour
-
brand bug typst
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
quarto-dev/quarto-cli#15311 ·
Les mainteneurs répondent en général sous 1 jour
-
Notebook preview header title takes the heading colour on the primary backgroundPeut-être pris @SabyaXSachi l’a pris il y a 5 jours. Ouverteaccessibility bug embed
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
quarto-dev/quarto-cli#15306 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bootstrap bug themes
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
quarto-dev/quarto-cli#15304 ·
Les mainteneurs répondent en général sous 1 jour
-
accessibility bug code-blocks html themes
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
quarto-dev/quarto-cli#15303 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de quarto-dev/quarto-cli
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
0. Needs triage bug feature: api
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
agent-os ai bug good first issue help wanted
Difficulté 1/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
area: documentation good first issue package: rule-data status: accepting prs
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
status: needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
mastra-ai/mastra#30109 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour