diff options
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 8 | ||||
-rw-r--r-- | tests/writer.dokuwiki | 5 |
2 files changed, 10 insertions, 3 deletions
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 $ "<HTML><blockquote>\n" ++ contents ++ "</blockquote></HTML>" 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: +<HTML><blockquote> +Code in a block quote: <code>sub status { print "working"; @@ -62,7 +63,7 @@ Nested block quotes: > nested > nested - +</blockquote></HTML> This should not be a block quote: 2 > 1. And a following paragraph. |