jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.14k stars 3.3k forks source link

markdown writer: problem with block quote in lists #9908

Closed kysko closed 1 week ago

kysko commented 1 week ago

Problem: If the first block of an item list is a block quote, the markdown (and commonmark_x) writer will omit the quote mark (>) on the first line of the block quote.

Consider:

*   > a
    >
    > b

The native output (pandoc -f markdown -t native) is as expected:

[ BulletList
    [ [ BlockQuote [ Para [ Str "a" ] , Para [ Str "b" ] ] ] ]
]

But converting to markdown (pandoc -f markdown -t markdown) will produce:

-   a
    >
    > b

Same for commonmark_x output. Same problem if we use ordered lists. (html output is ok.)

A second block quote block in the same list item will output correctly:

*   > a
    >
    > b

    > c

will give:

-   a
    >
    > b

    > c

Possible cause? In a custom writer, pandoc.layout.prefixed also caused this, possibly because it was not considered to be at the beginning of the line. So had to manually prefix the BlockQuote with layout.litteral'> '. Maybe it's similar in the Haskell code.

jgm commented 1 week ago

thanks!