Lua: for docx output, filters after `quarto` see a different environment

オープン
#1,320 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
lua
領域
documentation

調査の方向性

The bug sits in how filters listed after quarto in the filters: key are run inside pandoc for docx output, so start with the Lua filter runner and the code that sets PANDOC_VERSION and quarto.version for each filter. Reproduce with the ver.lua and ver.qmd snippets from the issue and compare the stderr and document output at each position. Done means both positions report the same PANDOC_VERSION and quarto.version and stderr from post filters is visible.

索引モデルが issue の本文から書いたものです。

説明

Tested with q2 0.47.0 and pandoc 3.14 (via QUARTO_PANDOC) on Windows 11, compared with Quarto 1.11.9 and plain pandoc 3.14.

For docx (and the other formats where post filters run inside pandoc), the same filter behaves differently depending on where it is in filters::

before quarto (and all filters for HTML) after quarto, docx
PANDOC_VERSION 3.0.0 3.14 (the real pandoc)
quarto.version 0.47.0 0
print / io.stderr:write shown dropped, unless the line starts with [WARNING] (then shown as Q-11-1)

Repro

ver.lua:

function Pandoc(doc)
  io.stderr:write("hello\n")
  doc.blocks:insert(pandoc.Para(pandoc.Str(
    "V=" .. tostring(PANDOC_VERSION) .. ",quarto=" .. tostring(quarto.version))))
  return doc
end
---
filters: [ver.lua, quarto, ver.lua]
---

X.

q2 render ver.qmd --to docx

Actual: "hello" is printed once; the document has V=3.0.0,quarto=0.47.0 and V=3.14,quarto=0.

Expected: the same values in both positions. PANDOC_VERSION 3.0.0 is a problem in its own right: filters and extensions that check PANDOC_VERSION >= "3.1" to pick a code path take the wrong one. Losing stderr makes post filters hard to debug.

主要言語
Rust
スター
316
フォーク
23
平均マージ
11時間 49分
マージ済み PR(30日)
245

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。