git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Improve line breaks with `<dd>` tags.

We now put a newline between `</dd>` and `<dd>` when there are multiple definitions.

commitbad3c88cb6fa65ffade5365001202c9c8df2a1c0 authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 11 Sep 2012, 08:51 (14 years ago) parent0189997
2 files changed+12−6
src/Text/Pandoc/Writers/HTML.hs+2−1 tests/writer.html+10−5
src/Text/Pandoc/Writers/HTML.hs+2−1
@@ -485,7 +485,8 @@ blockToHtml opts (DefinitionList lst) = do
485485 do term' <- liftM (H.dt) $ inlineListToHtml opts term
486486 defs' <- mapM ((liftM (\x -> H.dd $ (x >> nl opts))) .
487487 blockListToHtml opts) defs
488− return $ mconcat $ nl opts : term' : nl opts : defs') lst
488+ return $ mconcat $ nl opts : term' : nl opts :
489+ intersperse (nl opts) defs') lst
489490 let lst' = H.dl $ mconcat contents >> nl opts
490491 let lst'' = if writerIncremental opts
491492 then lst' ! A.class_ "incremental"
tests/writer.html+10−5
@@ -281,29 +281,34 @@ These should not be escaped: \$ \\ \&gt; \[ \{</code></pre>
281281<dl>
282282<dt>apple</dt>
283283<dd>red fruit
284−</dd><dd>computer
284+</dd>
285+<dd>computer
285286</dd>
286287<dt>orange</dt>
287288<dd>orange fruit
288−</dd><dd>bank
289+</dd>
290+<dd>bank
289291</dd>
290292</dl>
291293<p>Multiple definitions, loose:</p>
292294<dl>
293295<dt>apple</dt>
294296<dd><p>red fruit</p>
295−</dd><dd><p>computer</p>
297+</dd>
298+<dd><p>computer</p>
296299</dd>
297300<dt>orange</dt>
298301<dd><p>orange fruit</p>
299−</dd><dd><p>bank</p>
302+</dd>
303+<dd><p>bank</p>
300304</dd>
301305</dl>
302306<p>Blank line after term, indented marker, alternate markers:</p>
303307<dl>
304308<dt>apple</dt>
305309<dd><p>red fruit</p>
306−</dd><dd><p>computer</p>
310+</dd>
311+<dd><p>computer</p>
307312</dd>
308313<dt>orange</dt>
309314<dd><p>orange fruit</p>