From bad3c88cb6fa65ffade5365001202c9c8df2a1c0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 11 Sep 2012 08:51:08 -0700 Subject: [PATCH] HTML writer: Improve line breaks with `
` tags. We now put a newline between `
` and `
` when there are multiple definitions. --- src/Text/Pandoc/Writers/HTML.hs | 3 ++- tests/writer.html | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index c6c4a8fd7..bb8d1b242 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -485,7 +485,8 @@ blockToHtml opts (DefinitionList lst) = do do term' <- liftM (H.dt) $ inlineListToHtml opts term defs' <- mapM ((liftM (\x -> H.dd $ (x >> nl opts))) . blockListToHtml opts) defs - return $ mconcat $ nl opts : term' : nl opts : defs') lst + return $ mconcat $ nl opts : term' : nl opts : + intersperse (nl opts) defs') lst let lst' = H.dl $ mconcat contents >> nl opts let lst'' = if writerIncremental opts then lst' ! A.class_ "incremental" diff --git a/tests/writer.html b/tests/writer.html index c9ef6f1f1..67bb57ead 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -281,29 +281,34 @@ These should not be escaped: \$ \\ \> \[ \{
apple
red fruit -
computer +
+
computer
orange
orange fruit -
bank +
+
bank

Multiple definitions, loose:

apple

red fruit

-

computer

+
+

computer

orange

orange fruit

-

bank

+
+

bank

Blank line after term, indented marker, alternate markers:

apple

red fruit

-

computer

+
+

computer

orange

orange fruit