diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index aef247164..26f9b5f62 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -153,7 +153,9 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do blockToDokuWiki opts (BlockQuote blocks) = do contents <- blockListToDokuWiki opts blocks - return $ "> " ++ contents + if isSimpleBlockQuote blocks + then return $ "> " ++ contents + else return $ "
\n" ++ contents ++ "" blockToDokuWiki opts (Table capt aligns _ headers rows') = do let alignStrings = map alignmentToString aligns @@ -308,6 +310,10 @@ isPlainOrPara (Plain _) = True isPlainOrPara (Para _) = True isPlainOrPara _ = False +isSimpleBlockQuote :: [Block] -> Bool +isSimpleBlockQuote [BlockQuote bs] = isSimpleBlockQuote bs +isSimpleBlockQuote [b] = isPlainOrPara b +isSimpleBlockQuote _ = False -- | Concatenates strings with line breaks between them. vcat :: [String] -> String diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki index e1844d62a..9801ed262 100644 --- a/tests/writer.dokuwiki +++ b/tests/writer.dokuwiki @@ -47,7 +47,8 @@ E-mail style: > This is a block quote. It is pretty short. -> Code in a block quote: +
+Code in a block quote:
sub status {
print "working";
@@ -62,7 +63,7 @@ Nested block quotes:
> nested
> nested
-
+
This should not be a block quote: 2 > 1.
And a following paragraph.