.docx export ignores {.unnumbered .unlisted} in headers and prints them in TOC anyway

未關閉
#15,416 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
半天
新手友好度
52/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
javascript
領域
tooling

研究方向

Start by rendering the reporter's minimal .qmd with both docx: toc: true and typst: toc: true to confirm that only the Word output lists the {.unnumbered .unlisted} headings. Then compare the two output paths: the Typst writer honours the classes, so find where the docx table of contents is assembled and check whether the heading classes are inspected there at all before entries are emitted. Done means the Word TOC matches the Typst one for the sample document, with ordinary headings still numbered and listed.

由索引模型根據 Issue 內容生成。

描述

bug
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

At https://quarto.org/docs/output-formats/ms-word.html#table-of-contents, Quarto docs state that adding {.unnumbered .unlisted} to a heading will exclude it from the MS Word TOC, as it does in typst output. This does not appear to work.

Steps to reproduce

Render the following qmd.

---
title: "A test of the table of contents"
author: "Tester McTestface"
date: today
format: 
  typst:
    toc: true
  docx:
    toc: true
---

# Part 1

## Section 1

## Section 2

### [some notes] {.unnumbered .unlisted}

# Part 2

## Section 1

### [some more notes] {.unnumbered .unlisted}
Actual behavior

In Typst output, the unnumbered and unlisted headers do not appear in the TOC, as expected. They do appear in the MS Word TOC, however.

toc-test.pdf
toc-test.docx

Expected behavior

Unnumbered, unlisted headings should not appear in MS Word TOC, per Quarto docs.

Your environment
  • IDE: Positron 2026.11.1 build 4
  • OS: macOS 14.6
Quarto check output
sam@sam git % quarto check
Quarto 1.11.9
[✓] Checking environment information...
      Quarto cache location: /Users/sam/Library/Caches/quarto
      Project: none found (single-file mode)
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.10.0: OK
      Dart Sass version 1.101.0: OK
      Deno version 2.9.8: OK
      Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.11.9
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chrome Headless Shell: (not installed)
      VeraPDF: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/sam/Library/TinyTeX/bin/universal-darwin
      Version: 2026

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

[✓] Checking basic markdown render....OK

[✓] Checking R installation...........OK
      Version: 4.6.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.6/Resources/library
      knitr: 1.51
      rmarkdown: 2.31

[✓] Checking Knitr engine render......OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Library/Developer/CommandLineTools/usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking Julia installation...
主要語言
JavaScript
星號
6.2k
分支
492
平均合併
15 小時 15 分鐘
30 天內合併 PR
94

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

quarto-dev/quarto-cli 的其他 Issue

查看 quarto-dev/quarto-cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。