DecoratedCodeBlock has no docx/pptx renderer — code chunk `filename` header silently dropped
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with src/resources/filters/customnodes/decoratedcodeblock.lua and compare the existing HTML and LaTeX renderers with the fallback path. Render the provided repro with --to docx and --to pptx, then verify that a visible filename representation appears before the code block while HTML and LaTeX behavior remains unchanged.
索引モデルが issue の本文から書いたものです。
説明
Summary
A code block decorated with a filename (e.g. {r filename="hello.R"} or a .filename attribute) renders correctly in HTML, LaTeX, and Markdown output, but the filename header is silently dropped for docx and pptx (and any other format with no dedicated renderer registered).
Where the gap is
src/resources/filters/customnodes/decoratedcodeblock.lua registers exactly four renderers for the DecoratedCodeBlock custom AST node:
- A default/fallback renderer (predicate always
true) — walks the code block for folding only:_quarto.ast.add_renderer("DecoratedCodeBlock", function(_) return true end, function(node) return _quarto.ast.walk(node.code_block, { CodeBlock = render_folded_block }) end) - A markdown renderer (
_quarto.format.isMarkdownOutput()) - A latex renderer (
_quarto.format.isLatexOutput()) - An html renderer (
_quarto.format.isHtmlOutput())
Only the html and latex renderers actually read node.filename and render a header for it. Since docx/pptx match none of the three specific predicates, they fall through to the default renderer, which never reads node.filename (or node.caption) at all — it only walks for render_folded_block (itself a no-op for non-HTML output). The result: the code block content survives, but the filename header silently disappears, with no warning.
Repro
---
title: repro
---
```{.python filename="hello.py"}
print("hello")
Render with `quarto render repro.qmd --to docx` (or `--to pptx`). The code block appears; the "hello.py" filename header does not. Compare with `--to html` or `--to latex`, both of which show it.
## Suggested fix
Add a docx/pptx-aware renderer for `DecoratedCodeBlock` (or extend the default renderer to check `_quarto.format.isDocxOutput()`/`isPowerPointOutput()`) that emits *some* visible representation of `node.filename` — e.g. a bold paragraph immediately before the code block, mirroring the semantic intent of the html wrapper (`code-with-filename`) and the latex `\caption`, adapted to what Pandoc's docx/pptx writers can represent natively (Word/PowerPoint have no custom CSS to hook into, so this would need to be a plain paragraph/text run rather than a styled wrapper).
## Context
Found while auditing `decoratedcodeblock.lua`'s renderer coverage against Pandoc's non-core output targets (docx/pptx) for a project that reuses these filters. Confirmed against a fresh clone at `v1.11.3` (and current `main`, `83d48d8e8` — the file is unchanged between the two).
- 主要言語
- JavaScript
- スター
- 6.1k
- フォーク
- 463
- 平均マージ
- 21時間 53分
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
bug callouts regression revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
quarto-dev/quarto-cli#15014 ·
メンテナーはふだん 1 日以内に返信
-
Website navbar hides the notebook preview header対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンaccessibility bug embed websites
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/quarto-cli#14972 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
accessibility documentation revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
quarto-dev/quarto-cli#14971 ·
メンテナーはふだん 1 日以内に返信
-
accessibility revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
quarto-dev/quarto-cli#14970 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
a11y: notebook preview header is outside any landmark対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンaccessibility embed
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
quarto-dev/quarto-cli#14968 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto-cli の issue をすべて見る
似ている issue
-
[Bug] Composer can submit an IME confirmation when keyCode is 229 but isComposing is false対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/rocketmq-dashboard#6067 ·
メンテナーはふだん 4 日以内に返信
-
severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
luainkernel/lunatik#1853 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
factory-active factory-automatic harness/claude-code task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信