diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-03-11 07:54:47 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-03-11 07:54:47 +0000 |
commit | aca046702e68c75551072a49a615d49cc5887eb3 (patch) | |
tree | 46203e2b9c11180edb8c9fbe925aae4e717e9f3b /src/Text/Pandoc/Writers/HTML.hs | |
parent | 44cec96e61271575c5464adaba90180559898c1d (diff) | |
download | pandoc-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/Pandoc/Writers/HTML.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 16 |
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 |