From e8ad4ba43c7c187a5b6ee6025bc6039488d7f420 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 11 Jan 2011 20:37:06 -0800 Subject: Preliminary support for HTML5. + Added writerHtml5 writer option. + Added --html5 option. + Added support for lang in html tag (so you can do 'pandoc -s --V lang=en', for example). + Updated html template with conditionals for HTML5. + When HTML5 selected, use
tag around title in document, and use
tags instead of
s if --section-divs specified. --- src/Text/Pandoc/Writers/HTML.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Writers/HTML.hs') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index b8da4bec0..c61387fa7 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -170,6 +170,7 @@ inTemplate opts tit auths date toc body' newvars = , ("pagetitle", topTitle') , ("title", renderHtmlFragment tit) , ("date", date') ] ++ + [ ("html5","true") | writerHtml5 opts ] ++ (case toc of Just t -> [ ("toc", renderHtmlFragment t)] Nothing -> []) ++ @@ -226,7 +227,9 @@ elementToHtml opts (Sec level num id' title' elements) = do return $ if slides -- S5 gets confused by the extra divs around sections then toHtmlFromList stuff else if writerSectionDivs opts - then thediv ! [prefixedId opts id'] << stuff + then if writerHtml5 opts + then tag "section" << stuff + else thediv ! [prefixedId opts id'] << stuff else toHtmlFromList stuff -- | Convert list of Note blocks to a footnote
. -- cgit v1.2.3