mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-21 05:43:39 +08:00
HTML writer: always output <dt> element, even if it is empty
Fixes #4883
This commit is contained in:
@@ -830,9 +830,7 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
|
||||
return $ foldl (!) l attribs
|
||||
blockToHtml opts (DefinitionList lst) = do
|
||||
contents <- mapM (\(term, defs) ->
|
||||
do term' <- if null term
|
||||
then return mempty
|
||||
else liftM H.dt $ inlineListToHtml opts term
|
||||
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 :
|
||||
|
||||
@@ -43,4 +43,9 @@ tests = [ testGroup "inline code"
|
||||
image "/url" "title" ("my " <> emph "image")
|
||||
=?> "<img src=\"/url\" title=\"title\" alt=\"my image\" />"
|
||||
]
|
||||
, testGroup "blocks"
|
||||
[ "definition list with empty <dt>" =:
|
||||
definitionList [(mempty, [para $ text "foo bar"])]
|
||||
=?> "<dl><dt></dt><dd><p>foo bar</p></dd></dl>"
|
||||
]
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user