git.iko.soy/typeable/pandoc
on master help sign in
Use raw HTML for complex block quotes.

As far as I can see, dokuwiki markup is pretty limited in what can go in a `>` block quote: just a single line of paragraph text. (#1398)

commit3e95fd586dfc286cb1bb7300521ccd2a6d11bc1f authorJohn MacFarlane <jgm@berkeley.edu> dateSun 13 Jul 2014, 16:15 (12 years ago) parent8108828
2 files changed+10−3
src/Text/Pandoc/Writers/DokuWiki.hs+7−1 tests/writer.dokuwiki+3−2
src/Text/Pandoc/Writers/DokuWiki.hs+7−1
@@ -153,7 +153,9 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do
153153
154154blockToDokuWiki opts (BlockQuote blocks) = do
155155 contents <- blockListToDokuWiki opts blocks
156− return $ "> " ++ contents
156+ if isSimpleBlockQuote blocks
157+ then return $ "> " ++ contents
158+ else return $ "<HTML><blockquote>\n" ++ contents ++ "</blockquote></HTML>"
157159
158160blockToDokuWiki opts (Table capt aligns _ headers rows') = do
159161 let alignStrings = map alignmentToString aligns
@@ -308,6 +310,10 @@ isPlainOrPara (Plain _) = True
308310isPlainOrPara (Para _) = True
309311isPlainOrPara _ = False
310312
313+isSimpleBlockQuote :: [Block] -> Bool
314+isSimpleBlockQuote [BlockQuote bs] = isSimpleBlockQuote bs
315+isSimpleBlockQuote [b] = isPlainOrPara b
316+isSimpleBlockQuote _ = False
311317
312318-- | Concatenates strings with line breaks between them.
313319vcat :: [String] -> String
tests/writer.dokuwiki+3−2
@@ -47,7 +47,8 @@ E-mail style:
4747
4848> This is a block quote. It is pretty short.
4949
50−> Code in a block quote:
50+<HTML><blockquote>
51+Code in a block quote:
5152
5253<code>sub status {
5354 print "working";
@@ -62,7 +63,7 @@ Nested block quotes:
6263> nested
6364
6465> nested
65−
66+</blockquote></HTML>
6667This should not be a block quote: 2 > 1.
6768
6869And a following paragraph.