diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-08-08 23:14:12 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-08-08 23:14:12 -0700 |
commit | e9de0f0e22b9b64b5684efe81d03539c3f57a71c (patch) | |
tree | 6a5f6a6ad5d4cf95f4e3ea3106a7db9c1a97b547 /src/Text/Pandoc/Writers/HTML.hs | |
parent | 99bb066bb925134b506d39c8d6694fe81337d9c1 (diff) | |
download | pandoc-e9de0f0e22b9b64b5684efe81d03539c3f57a71c.tar.gz |
Preliminary support for new Div and Span elements in writers.
Currently these are "transparent" containers, except in HTML,
where they produce div and span elements with attributes.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index cfc187e02..560c26c76 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -407,6 +407,9 @@ blockToHtml opts (Para [Str ".",Space,Str ".",Space,Str "."]) blockToHtml opts (Para lst) = do contents <- inlineListToHtml opts lst return $ H.p contents +blockToHtml opts (Div attr bs) = do + contents <- blockListToHtml opts bs + return $ addAttrs opts attr $ H.div $ nl opts >> contents >> nl opts blockToHtml _ (RawBlock "html" str) = return $ preEscapedString str blockToHtml _ (RawBlock _ _) = return mempty blockToHtml opts (HorizontalRule) = return $ if writerHtml5 opts then H5.hr else H.hr @@ -590,6 +593,8 @@ inlineToHtml opts inline = (Str str) -> return $ strToHtml str (Space) -> return $ strToHtml " " (LineBreak) -> return $ if writerHtml5 opts then H5.br else H.br + (Span attr ils) -> inlineListToHtml opts ils >>= + return . addAttrs opts attr . H.span (Emph lst) -> inlineListToHtml opts lst >>= return . H.em (Strong lst) -> inlineListToHtml opts lst >>= return . H.strong (Code attr str) -> case hlCode of |