quarto-dev / quarto-dev/q2

qmd writer turns a loose bullet list into a tight one when items contain a nested sublist

Open
#174 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug readers-writers
Dominant language
Rust
Stars
255
Forks
17
Avg merge
6h 20m
Merged PRs (30d)
109

Description

A BulletList parsed as loose (each item's first block is Paragraph) round-trips as tight (Plain) when at least one item contains a nested sublist. The writer emits blank-line separators between top-level items but the re-parser does not treat the resulting source as loose, so the outer list collapses. Symptom: items[[i]][[1]]$tag = "Plain" after the round trip where the original was "Paragraph".

$ printf -- '-   a\n\n    -   c\n    -   d\n\n-   b\n' 
-   a

    -   c
    -   d

-   b

$ printf -- '-   a\n\n    -   c\n    -   d\n\n-   b\n' | cargo run --bin pampa --
[ BulletList [[Para [Str "a"], BulletList [[Plain [Str "c"]], [Plain [Str "d"]]]], [Para [Str "b"]]] ]

$ printf -- '-   a\n\n    -   c\n    -   d\n\n-   b\n' | cargo run --bin pampa -- -t qmd
* a
  
  * c
  * d

* b

$ printf -- '-   a\n\n    -   c\n    -   d\n\n-   b\n' | cargo run --bin pampa -- -t qmd | cargo run --bin pampa --
[ BulletList [[Plain [Str "a"], BulletList [[Plain [Str "c"]], [Plain [Str "d"]]]], [Plain [Str "b"]]] ]

Examples in quarto-web:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the round trip with the cargo run --bin pampa -- -t qmd entry point and compare the original and re-parsed BulletList structure. The fix is done when a loose outer list containing a nested sublist remains Paragraph-based after qmd writing and parsing, matching the issue's symptom.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.