jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.89k stars 3.34k forks source link

DokuWiki blockquote with linebreaks #6461

Open vaniwiki opened 4 years ago

vaniwiki commented 4 years ago
> When I have blockquote markup like this
> it will render as one html blockquote, but with <br/>
> at the end of each line. Possible to fix?
jgm commented 4 years ago

It doesn't seem to do that: https://pandoc.org/try/?text=%3E+test+one%0A%3E+test+two%0A%3E+test+three%0A&from=dokuwiki&to=html5&standalone=0 Are you using an old version prehaps?

vaniwiki commented 4 years ago

No, what I mean is that the actual DokuWiki parser does this, which is what I want. I am using the blockquote markup for ancient poetry, spanning tens of thousands of documents, and thought to use Pandoc to convert these to PDF's. I didn't know about the Pandoc test though, that's handy.

jgm commented 4 years ago

Oh, I see -- in a dokuwiki block quote there's a hard line break inserted after each line? We could change pandoc's parser to do that. Can you point to documentation or a live demo?

vaniwiki commented 4 years ago

I didn't find it specifically mentioned in documentation, but I made a quick test in the DokuWiki playground: https://dokuwiki.org/playground:playground

vaniwiki commented 4 years ago

While I'm at it, DokuWiki makes three hyphens (---) into an em-dash. Two hyphens (--) becomes an en-dash. I'll include those in the playground test, done.

jgm commented 4 years ago

Can you adjust the playground to show what happens when you have blank lines, lists, etc inside the blockquote?

> foo bra
> baz
>
> bim bam
>
>  - one
>  - two
>
> > nested
> unnested
vaniwiki commented 4 years ago

Updated to exact specifications, with one exception, nested must be >> with no space between.

jgm commented 4 years ago

OK, looks like for blank lines we just get two <br>s, and the list isn't parsed as a list.

vaniwiki commented 4 years ago

In my case, I use this markup exclusively for poetry, so no nesting or lists, but the occasional blank line between two combined verses. I assume these things should have been better documented in DokuWiki already, but I think it is wonderful that you're adding this support to Pandoc! :)

Also, if not too much hassle don't forget about the en and em dashes, -- and --- respectively.