qmd writer turns a loose bullet list into a tight one when items contain a nested sublist
Nobody has claimed this yet.
- 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:
- https://github.com/quarto-dev/quarto-web/blob/8b1be24df1c9301f2700c77e41e7a9f789535717/docs/blog/posts/2024-04-01-manuscripts-rmedicine/index.qmd#L19
- https://github.com/quarto-dev/quarto-web/blob/8b1be24df1c9301f2700c77e41e7a9f789535717/docs/authoring/_shortcodes.qmd#L30
- https://github.com/quarto-dev/quarto-web/blob/8b1be24df1c9301f2700c77e41e7a9f789535717/docs/journals/authors.qmd#L142
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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