git.iko.soy/typeable/pandoc
on master help sign in
Use raw HTML for complex block quotes.
3e95fd5John MacFarlane
src/Text/Pandoc/Writers/DokuWiki.hs+7−1
@@ -153,7 +153,9 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do
153
153
154blockToDokuWiki opts (BlockQuote blocks) = do
154blockToDokuWiki opts (BlockQuote blocks) = do
155 contents <- blockListToDokuWiki opts blocks
155 contents <- blockListToDokuWiki opts blocks
156+ if isSimpleBlockQuote blocks
156− return $ "> " ++ contents
157+ then return $ "> " ++ contents
158+ else return $ "<HTML><blockquote>\n" ++ contents ++ "</blockquote></HTML>"
157
159
158blockToDokuWiki opts (Table capt aligns _ headers rows') = do
160blockToDokuWiki opts (Table capt aligns _ headers rows') = do
159 let alignStrings = map alignmentToString aligns
161 let alignStrings = map alignmentToString aligns
@@ -308,6 +310,10 @@ isPlainOrPara (Plain _) = True
308isPlainOrPara (Para _) = True
310isPlainOrPara (Para _) = True
309isPlainOrPara _ = False
311isPlainOrPara _ = False
310
312
313+isSimpleBlockQuote :: [Block] -> Bool
314+isSimpleBlockQuote [BlockQuote bs] = isSimpleBlockQuote bs
315+isSimpleBlockQuote [b] = isPlainOrPara b
316+isSimpleBlockQuote _ = False
311
317
312-- | Concatenates strings with line breaks between them.
318-- | Concatenates strings with line breaks between them.
313vcat :: [String] -> String
319vcat :: [String] -> String
tests/writer.dokuwiki+3−2
@@ -47,7 +47,8 @@ E-mail style:
47
47
48> This is a block quote. It is pretty short.
48> This is a block quote. It is pretty short.
49
49
50+<HTML><blockquote>
50−> Code in a block quote:
51+Code in a block quote:
51
52
52<code>sub status {
53<code>sub status {
53 print "working";
54 print "working";
@@ -62,7 +63,7 @@ Nested block quotes:
62> nested
63> nested
63
64
64> nested
65> nested
65−
66+</blockquote></HTML>
66This should not be a block quote: 2 > 1.
67This should not be a block quote: 2 > 1.
67
68
68And a following paragraph.
69And a following paragraph.