DokuWiki writer: Better handling of block quotes.
This change ensures that multiple paragraph blockquotes are rendered using native `>` rather than as HTML. Closes #1738.
This commit is contained in:
parent
0169e10344
commit
f3ac41937d
2 changed files with 5 additions and 6 deletions
|
@ -178,7 +178,7 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do
|
|||
blockToDokuWiki opts (BlockQuote blocks) = do
|
||||
contents <- blockListToDokuWiki opts blocks
|
||||
if isSimpleBlockQuote blocks
|
||||
then return $ "> " ++ contents
|
||||
then return $ unlines $ map ("> " ++) $ lines contents
|
||||
else return $ "<HTML><blockquote>\n" ++ contents ++ "</blockquote></HTML>"
|
||||
|
||||
blockToDokuWiki opts (Table capt aligns _ headers rows) = do
|
||||
|
@ -352,9 +352,7 @@ isPlainOrPara (Para _) = True
|
|||
isPlainOrPara _ = False
|
||||
|
||||
isSimpleBlockQuote :: [Block] -> Bool
|
||||
isSimpleBlockQuote [BlockQuote bs] = isSimpleBlockQuote bs
|
||||
isSimpleBlockQuote [b] = isPlainOrPara b
|
||||
isSimpleBlockQuote _ = False
|
||||
isSimpleBlockQuote bs = all isPlainOrPara bs
|
||||
|
||||
-- | Concatenates strings with line breaks between them.
|
||||
vcat :: [String] -> String
|
||||
|
|
|
@ -268,7 +268,8 @@ Multiple blocks with italics:
|
|||
<HTML><dt></HTML>//orange//<HTML></dt></HTML>
|
||||
<HTML><dd></HTML><HTML><p></HTML>orange fruit<HTML></p></HTML>
|
||||
<code>{ orange code block }</code>
|
||||
> <HTML><p></HTML>orange block quote<HTML></p></HTML><HTML></dd></HTML><HTML></dl></HTML>
|
||||
> <HTML><p></HTML>orange block quote<HTML></p></HTML>
|
||||
<HTML></dd></HTML><HTML></dl></HTML>
|
||||
|
||||
Multiple definitions, tight:
|
||||
|
||||
|
@ -611,7 +612,7 @@ If you want, you can indent every line, but you can also be lazy and just indent
|
|||
))
|
||||
|
||||
> Notes can go in quotes.((In quote.
|
||||
))
|
||||
> ))
|
||||
|
||||
- And in list items.((In list.))
|
||||
|
||||
|
|
Loading…
Reference in a new issue