Skip to content

number-sections does not number headers with GFM output format #8113

@ivan-paleo

Description

@ivan-paleo

Bug description

When rendering to GFM, number-sections: true does not add numbers to headers, only to the ToC.
It works as expected when rendering to HTML. I could not find an existing issue or a discussion in the Q&A, but maybe I've missed it.
Since number-sections is listed in the GFM options, I would expect it to work just like with HTML. If not possible, maybe the help should be adjusted.

Steps to reproduce

---
title: "test"
format: 
  gfm: default
toc: true
number-sections: true
---

# header1

# header2

## subheader2-1

## subheader2-2

Expected behavior

Same as with HTML:

---
title: "test"
format: 
  html: default
toc: true
number-sections: true
---

# header1

# header2

## subheader2-1

## subheader2-2

Actual behavior

The ToC is numbered but not the headers when rendering to GFM. Both are numbered when rendering to HTML.

Your environment

VScodium Version: 1.85.1 (user setup)
Release: 23348
Commit: 08e6c15293922dd53a864bb041be381322fee401
Date: 2023-12-14T20:44:42.949Z
Electron: 25.9.7
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

Quarto check output

[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.3.450
Path: C:\Program Files\Quarto\bin
CodePage: 1252

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

[>] Checking Python 3 installation....OK
Version: 3.8.5
Path: C:/Users/calandra.RGZM/AppData/Local/Programs/Python/Python38/python
.exe
Jupyter: (None)

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

[>] Checking R installation...........OK
Version: 4.3.2
Path: C:/PROGRA1/R/R-431.2
LibPaths:
- C:/Users/calandra.RGZM/AppData/Local/R/win-library/4.3
- C:/Program Files/R/R-4.3.2/library
knitr: 1.45
rmarkdown: 2.25

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmarkdownRelated to markdown-like output format

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions