Readable bookmark names for cross-reference targets in docx output
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- documentation
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- JavaScript
- Estrellas
- 6.2k
- Forks
- 482
- Merge medio
- 17 h 46 min
- PR fusionados (30 d)
- 135
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quarto-dev/quarto-cli
-
Listing category filter and URL hash disagree after Back, or with `&`, `=` or `%` in a categoryAbiertobug listings
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
quarto-dev/quarto-cli#15340 ·
Los mantenedores suelen responder en 1 día
-
brand bug typst
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/quarto-cli#15311 ·
Los mantenedores suelen responder en 1 día
-
Notebook preview header title takes the heading colour on the primary backgroundPosiblemente ocupada @SabyaXSachi la tomó hace 5 días. Abiertoaccessibility bug embed
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
quarto-dev/quarto-cli#15306 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bootstrap bug themes
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
quarto-dev/quarto-cli#15304 ·
Los mantenedores suelen responder en 1 día
-
accessibility bug code-blocks html themes
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/quarto-cli#15303 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/quarto-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
0. Needs triage bug feature: api
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
agent-os ai bug good first issue help wanted
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area: documentation good first issue package: rule-data status: accepting prs
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
mastra-ai/mastra#30109 · 2 comentarios ·
Los mantenedores suelen responder en 1 día