`include-before-body` and `include-after-body` have no effect for docx output
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, lua
- Bereich
- backend
Rechercherichtung
Start with src/resources/filters/quarto-init/includes.lua and src/resources/filters/common/meta.lua, which the issue links to, and trace how include content becomes a raw block for docx. Check the existing tests for docx includes, then reproduce with the provided before.xml and after.xml example. Done means both markers appear in word/document.xml for include-before-body and include-after-body.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
Since Pandoc 3.2.1, --include-before-body and --include-after-body work with docx: the files are OpenXML fragments inserted in the document body. With Quarto, their content never reaches word/document.xml. The same happens with text in include-before and include-after.
Quarto reads include files in a Lua filter and adds their content to the metadata as a raw block, with FORMAT as the raw format:
For docx, FORMAT is docx, so the raw block is RawBlock("docx", ...). Pandoc's docx writer only keeps raw openxml and drops the rest. A markdown document with both a ```{=docx} and a ```{=openxml} block shows it: only the openxml one is in the output.
Steps to reproduce
before.xml:
<w:p><w:r><w:t>MARKER-BEFORE</w:t></w:r></w:p>
after.xml:
<w:p><w:r><w:t>MARKER-AFTER</w:t></w:r></w:p>
doc.qmd:
---
title: Hello
format:
docx:
include-before-body: before.xml
include-after-body: after.xml
---
Body text.
quarto render doc.qmd
unzip -p doc.docx word/document.xml | grep -o 'MARKER-[A-Z]*'
Actual behavior
No output: neither paragraph is in word/document.xml. Same with include-before: '<w:p>...</w:p>' and include-after: in YAML.
Expected behavior
Both paragraphs are in the document, like with Pandoc directly:
quarto pandoc -f markdown -t docx --include-before-body before.xml --include-after-body after.xml -o p.docx doc.qmd
unzip -p p.docx word/document.xml | grep -o 'MARKER-[A-Z]*'
# MARKER-BEFORE
# MARKER-AFTER
A post-render Lua filter that changes the format of these raw blocks in include-before to openxml makes the paragraph appear, and the result opens in Word. We could use openxml as the raw format for docx when adding includes.
Your environment
- OS: Windows 11
- Same result with Quarto 1.11.9, 1.12.3, and
mainat cda4102 (Pandoc 3.13). Not a regression as far as I can tell.
Related: #15399
- Vorherrschende Sprache
- JavaScript
- Sterne
- 6.2k
- Forks
- 492
- Ø Merge
- 15 Std. 15 Min.
- Gemergte PRs (30 T.)
- 94
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
-
bootstrap enhancement themes
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
quarto-dev/quarto-cli#15421 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
quarto-dev/quarto-cli#15408 ·
Maintainer antworten meist innerhalb von 1 Tag
-
accessibility bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
quarto-dev/quarto-cli#15401 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug callouts docx regression
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 81/100
quarto-dev/quarto-cli#15394 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug lightbox
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
quarto-dev/quarto-cli#15393 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in quarto-dev/quarto-cli
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
testing-library/jest-dom#749 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
ernst:4-klein prio:3-wacht ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
NewspeedyNL/PidLane#767 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug for-agent ready
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
WenyuChiou/agent-board#1812 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug help wanted Should Have ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
hannahro15/Musical-Match-Saga#327 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag