Skip to content

Fix duplicated Quarto markdown list text - #2183

Open
LeonidasZhak wants to merge 1 commit into
rstudio:masterfrom
LeonidasZhak:fix/markdown-list-duplication-2140
Open

LeonidasZhak wants to merge 1 commit into
rstudio:masterfrom
LeonidasZhak:fix/markdown-list-duplication-2140

Conversation

@LeonidasZhak

@LeonidasZhak LeonidasZhak commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix duplicated list text in Quarto output for fmt_markdown() cells.

Thanks to maintainers

Thanks to the gt maintainers for triaging this issue and maintaining Quarto support.

Issue or motivation

Closes #2140. A list-only Markdown cell still duplicates its items in newer Quarto, despite the earlier fix for a similar case in #1957.

Root cause

The base64 wrapper added for #1957 in #1958 handles Quarto's text escaping, but its inline <span> containers remain around block Markdown. Newer Quarto treats the list content as inline text while retaining the list markup, which duplicates the item text.

Change

Use block-level <div> containers when the rendered Markdown contains block elements, while preserving <span> containers for inline-only content. Add regression coverage for both cases and a NEWS entry.

Tests

  • devtools::test(filter = "fmt_markdown"): 22 passed.
  • Quarto 1.9.38 reproduction: each list item appears once in the rendered table.
  • R CMD build --no-manual --compact-vignettes=gs+qpdf: passed.
  • R CMD check --as-cran --no-manual: passed with one NOTE for the development version.
  • Local covr::package_coverage() and Cobertura export: passed, 75.46% coverage.
  • pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE): passed; reported existing missing alt-text notices.

Scope

Changes only the Quarto HTML wrapper selected for block versus inline Markdown, with regression coverage for fmt_markdown() and a NEWS entry. It leaves inline-only markup, non-Quarto rendering, and other output formats unchanged.

  • I understand and agree to the Code of Conduct.
  • I have listed the change in NEWS.
  • I have added testthat coverage.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markdown bulleted list in cell - duplicated text

1 participant