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

Abierto
#1,028 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
compilers

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
293
Forks
20
Merge medio
12 h 21 min
PR fusionados (30 d)
178

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quarto-dev/q2

Todos los issues de quarto-dev/q2

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.