Letter, roman and `#.` list markers are read as paragraphs

Aperta
#1,028 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
compilers

Direzione di ricerca

Start with crates/tree-sitter-qmd/tree-sitter-markdown/src/scanner.c, especially the scanner dispatch and parse_ordered_list_marker, then trace how crates/pampa/src/pandoc/treesitter_utils/list_marker.rs stores and parses markers. The issue leaves open whether q2 should support these markers or warn and document their absence, so clarify that decision first. Done means the chosen behavior is explicit and the reproduction no longer silently renders list markers as paragraphs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

readers-writers
Bug description

Pandoc reads a), A., (i) and #. at the start of a line as ordered list markers (the fancy_lists extension).
Quarto 1 has it on by default, and writes ol type="a", ol type="A", ol type="i" or a plain ol.
q2 only accepts digits in front of . or ), so every other marker stays text, with no warning.

A q2 design note for the docx import work already records that qmd has no fancy list markers.
That work reports the lost list style and leaves the parser as it is, so the note does not say whether q2 plans to support these markers:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/claude-notes/plans/2026-10-03-document-import-epic.md?plain=1#L44

Nothing tells a user, and a Quarto 1 document changes meaning without an error.

The scanner sends a line to parse_ordered_list_marker only when it starts with a digit, and that function has no branch for letters, roman numerals or #:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/tree-sitter-qmd/tree-sitter-markdown/src/scanner.c#L1400-L1413

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/tree-sitter-qmd/tree-sitter-markdown/src/scanner.c#L3359-L3373

The marker is then stored as a number, and process_list_marker parses it as usize:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/pampa/src/pandoc/treesitter_utils/list_marker.rs#L25-L41

Steps to reproduce

index.qmd:

---
format: html
---

a) First

b) Second

Run q2 and Quarto 1 on it:

q2 render index.qmd --to html
quarto render index.qmd --to html
Actual behavior

q2 renders two paragraphs and the HTML has no ol:

<p>a) First</p>
<p>b) Second</p>

Quarto 1.12.0 renders an ordered list:

<ol type="a">
<li><p>First</p></li>
<li><p>Second</p></li>
</ol>
Expected behavior

The markers give ordered lists with the matching type attribute, as in Quarto 1.
If q2 does not plan to support these markers, the notes on differences from Quarto 1 could say so, and q2 could warn when a line starts with one of them.

Your environment
  • q2: Q2 (quarto 2) 0.40.0-nightly.20261101 (nightly built from a2a1cb9).
  • Quarto 1 for comparison: 1.12.0 (pre-release).
  • OS: macOS 27.2 (arm64).
  • Terminal, no IDE.
Lingua principale
Rust
Stelle
293
Fork
20
Merge medio
12h 30m
PR unite (30g)
175

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quarto-dev/q2

Tutte le issue di quarto-dev/q2

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.