HTML writer: Improve line breaks with <dd> tags.

We now put a newline between `</dd>` and `<dd>` when
there are multiple definitions.
This commit is contained in:
John MacFarlane 2012-09-11 08:51:08 -07:00
parent 0189997420
commit bad3c88cb6
2 changed files with 12 additions and 6 deletions

View file

@ -485,7 +485,8 @@ blockToHtml opts (DefinitionList lst) = do
do term' <- liftM (H.dt) $ inlineListToHtml opts term do term' <- liftM (H.dt) $ inlineListToHtml opts term
defs' <- mapM ((liftM (\x -> H.dd $ (x >> nl opts))) . defs' <- mapM ((liftM (\x -> H.dd $ (x >> nl opts))) .
blockListToHtml opts) defs 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' = H.dl $ mconcat contents >> nl opts
let lst'' = if writerIncremental opts let lst'' = if writerIncremental opts
then lst' ! A.class_ "incremental" then lst' ! A.class_ "incremental"

View file

@ -281,29 +281,34 @@ These should not be escaped: \$ \\ \&gt; \[ \{</code></pre>
<dl> <dl>
<dt>apple</dt> <dt>apple</dt>
<dd>red fruit <dd>red fruit
</dd><dd>computer </dd>
<dd>computer
</dd> </dd>
<dt>orange</dt> <dt>orange</dt>
<dd>orange fruit <dd>orange fruit
</dd><dd>bank </dd>
<dd>bank
</dd> </dd>
</dl> </dl>
<p>Multiple definitions, loose:</p> <p>Multiple definitions, loose:</p>
<dl> <dl>
<dt>apple</dt> <dt>apple</dt>
<dd><p>red fruit</p> <dd><p>red fruit</p>
</dd><dd><p>computer</p> </dd>
<dd><p>computer</p>
</dd> </dd>
<dt>orange</dt> <dt>orange</dt>
<dd><p>orange fruit</p> <dd><p>orange fruit</p>
</dd><dd><p>bank</p> </dd>
<dd><p>bank</p>
</dd> </dd>
</dl> </dl>
<p>Blank line after term, indented marker, alternate markers:</p> <p>Blank line after term, indented marker, alternate markers:</p>
<dl> <dl>
<dt>apple</dt> <dt>apple</dt>
<dd><p>red fruit</p> <dd><p>red fruit</p>
</dd><dd><p>computer</p> </dd>
<dd><p>computer</p>
</dd> </dd>
<dt>orange</dt> <dt>orange</dt>
<dd><p>orange fruit</p> <dd><p>orange fruit</p>