diff options
author | John MacFarlane <jgm@berkeley.edu> | 2012-09-12 17:44:13 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2012-09-12 17:44:13 -0700 |
commit | bf77889e195121cec03490fc22f68975574abcad (patch) | |
tree | 5fa1385f48555befe85e28a87ae978b6e9dbae16 /src/Text | |
parent | bbbbee021dc8c511bef922dd2911a65421eaf846 (diff) | |
download | pandoc-bf77889e195121cec03490fc22f68975574abcad.tar.gz |
HTML writer: Don't print `<dt>` unless term is non-empty.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index bb8d1b242..ebb705a61 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -482,7 +482,9 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do return $ foldl (!) (ordList opts contents) attribs blockToHtml opts (DefinitionList lst) = do contents <- mapM (\(term, defs) -> - do term' <- liftM (H.dt) $ inlineListToHtml opts term + do term' <- if null term + then return mempty + else 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 : |