diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-09-11 08:51:08 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-09-12 08:45:03 -0700 |
commit | bad3c88cb6fa65ffade5365001202c9c8df2a1c0 (patch) | |
tree | 64a149b2a368d66d4c83dd73ddf9d7250cf53107 | |
parent | 0189997420cff0a38637a522d880815e1ee201c4 (diff) | |
download | pandoc-bad3c88cb6fa65ffade5365001202c9c8df2a1c0.tar.gz |
HTML writer: Improve line breaks with `<dd>` tags.
We now put a newline between `</dd>` and `<dd>` when
there are multiple definitions.
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 3 | ||||
-rw-r--r-- | 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: \$ \\ \> \[ \{</code></pre> <dl> <dt>apple</dt> <dd>red fruit -</dd><dd>computer +</dd> +<dd>computer </dd> <dt>orange</dt> <dd>orange fruit -</dd><dd>bank +</dd> +<dd>bank </dd> </dl> <p>Multiple definitions, loose:</p> <dl> <dt>apple</dt> <dd><p>red fruit</p> -</dd><dd><p>computer</p> +</dd> +<dd><p>computer</p> </dd> <dt>orange</dt> <dd><p>orange fruit</p> -</dd><dd><p>bank</p> +</dd> +<dd><p>bank</p> </dd> </dl> <p>Blank line after term, indented marker, alternate markers:</p> <dl> <dt>apple</dt> <dd><p>red fruit</p> -</dd><dd><p>computer</p> +</dd> +<dd><p>computer</p> </dd> <dt>orange</dt> <dd><p>orange fruit</p> |