$ printf '> Before\n> $$\n> p = q\n> $$\n> After\n'
> Before
> $$
> p = q
> $$
> After
$ printf '> Before\n> $$\n> p = q\n> $$\n> After\n' | cargo run --bin pampa --
[ BlockQuote [Para [Str "Before", SoftBreak, Math DisplayMath "\n> p = q\n> ", SoftBreak, Str "After"]] ]
$ printf '> Before\n> $$\n> p = q\n> $$\n> After\n' | cargo run --bin pampa -- -t qmd
> Before
> $$
> > p = q
> > $$
> After
$ printf '> Before\n> $$\n> p = q\n> $$\n> After\n' | cargo run --bin pampa -- -t qmd | cargo run --bin pampa --
[ BlockQuote [Para [Str "Before", SoftBreak, Math DisplayMath "\n> > p = q\n> > ", SoftBreak, Str "After"]] ]
This seems like a parser bug (math content retains the blockquote prefix bytes) rather than a writer bug.
A
$$ ... $$display-math block placed inside a blockquote parses with the blockquote>prefix retained inside the math content string (e.g."\n> p = q\n> "). The qmd writer then re-prefixes every line with>when emitting the blockquote, producing> > p = qand> > $$. Each pass through the round trip adds another>level.This seems like a parser bug (math content retains the blockquote prefix bytes) rather than a writer bug.
From quarto-web: