aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-11 07:54:47 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-11 07:54:47 +0000
commitaca046702e68c75551072a49a615d49cc5887eb3 (patch)
tree46203e2b9c11180edb8c9fbe925aae4e717e9f3b /src/Text
parent44cec96e61271575c5464adaba90180559898c1d (diff)
downloadpandoc-aca046702e68c75551072a49a615d49cc5887eb3.tar.gz
Added support for DefinitionList blocks to HTML writer.
Cleaned up bullet and ordered list code by using ordList and unordList instead of raw olist and ulist. git-svn-id: https://pandoc.googlecode.com/svn/trunk@571 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index f4861fe0b..5f42679b4 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -163,12 +163,18 @@ blockToHtml opts (BulletList lst) =
let attribs = if writerIncremental opts
then [theclass "incremental"]
else [] in
- ulist ! attribs $ toHtmlFromList $ map (listItemToHtml opts) lst
+ unordList ! attribs $ map (blockListToHtml opts) lst
blockToHtml opts (OrderedList lst) =
let attribs = if writerIncremental opts
then [theclass "incremental"]
else [] in
- olist ! attribs $ toHtmlFromList $ map (listItemToHtml opts) lst
+ ordList ! attribs $ map (blockListToHtml opts) lst
+blockToHtml opts (DefinitionList lst) =
+ let attribs = if writerIncremental opts
+ then [theclass "incremental"]
+ else [] in
+ defList ! attribs $ map (\(term, def) -> (inlineListToHtml opts term,
+ blockListToHtml opts def)) lst
blockToHtml opts HorizontalRule = hr
blockToHtml opts (Header level lst) =
let contents = inlineListToHtml opts lst in
@@ -210,9 +216,9 @@ tableItemToHtml opts tag align' width item =
else [] in
tag ! attrib $ toHtmlFromList $ map (blockToHtml opts) item
-listItemToHtml :: WriterOptions -> [Block] -> Html
-listItemToHtml opts list =
- li $ toHtmlFromList $ map (blockToHtml opts) list
+blockListToHtml :: WriterOptions -> [Block] -> Html
+blockListToHtml opts list =
+ toHtmlFromList $ map (blockToHtml opts) list
-- | Convert list of Pandoc inline elements to HTML.
inlineListToHtml :: WriterOptions -> [Inline] -> Html