git.iko.soy/typeable/pandoc
on master help sign in
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

commitaca046702e68c75551072a49a615d49cc5887eb3 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 11 Mar 2007, 07:54 (20 years ago) parent44cec96
1 file changed+11−5
src/Text/Pandoc/Writers/HTML.hs+11−5
src/Text/Pandoc/Writers/HTML.hs+11−5
@@ -163,12 +163,18 @@ blockToHtml opts (BulletList lst) =
163163 let attribs = if writerIncremental opts
164164 then [theclass "incremental"]
165165 else [] in
166− ulist ! attribs $ toHtmlFromList $ map (listItemToHtml opts) lst
166+ unordList ! attribs $ map (blockListToHtml opts) lst
167167blockToHtml opts (OrderedList lst) =
168168 let attribs = if writerIncremental opts
169169 then [theclass "incremental"]
170170 else [] in
171− olist ! attribs $ toHtmlFromList $ map (listItemToHtml opts) lst
171+ ordList ! attribs $ map (blockListToHtml opts) lst
172+blockToHtml opts (DefinitionList lst) =
173+ let attribs = if writerIncremental opts
174+ then [theclass "incremental"]
175+ else [] in
176+ defList ! attribs $ map (\(term, def) -> (inlineListToHtml opts term,
177+ blockListToHtml opts def)) lst
172178blockToHtml opts HorizontalRule = hr
173179blockToHtml opts (Header level lst) =
174180 let contents = inlineListToHtml opts lst in
@@ -210,9 +216,9 @@ tableItemToHtml opts tag align' width item =
210216 else [] in
211217 tag ! attrib $ toHtmlFromList $ map (blockToHtml opts) item
212218
213−listItemToHtml :: WriterOptions -> [Block] -> Html
214−listItemToHtml opts list =
215− li $ toHtmlFromList $ map (blockToHtml opts) list
219+blockListToHtml :: WriterOptions -> [Block] -> Html
220+blockListToHtml opts list =
221+ toHtmlFromList $ map (blockToHtml opts) list
216222
217223-- | Convert list of Pandoc inline elements to HTML.
218224inlineListToHtml :: WriterOptions -> [Inline] -> Html