`include-before-body` and `include-after-body` have no effect for docx output
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, lua
- 領域
- backend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 6.2k
- フォーク
- 492
- 平均マージ
- 15時間 15分
- マージ済み PR(30日)
- 94
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
bootstrap enhancement themes
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
quarto-dev/quarto-cli#15421 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
quarto-dev/quarto-cli#15408 ·
メンテナーはふだん 1 日以内に返信
-
accessibility bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
quarto-dev/quarto-cli#15401 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug callouts docx regression
難易度 2/5 1〜3時間 初心者へのやさしさ 81/100
quarto-dev/quarto-cli#15394 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug lightbox
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
quarto-dev/quarto-cli#15393 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto-cli の issue をすべて見る
似ている issue
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
LangerSword/gitone#7 ·
-
good first issue reliability security should-have
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 13 日以内に返信
-
[BUG]: chunkSource protocol stripping truncates URLs or reads an inner scheme対応中かも @Bensonbenyi が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Mintplex-Labs/anything-llm#7338 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信