From 5e38d6a68940b937c3ba069596978e5992e20d4a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 18 Dec 2011 13:09:58 -0800 Subject: HTML writer: Put classes "section" and "level[1-6]" on section divs. (In HTML 5, the "section" class is omitted, since the tag itself is "section.") --- src/Text/Pandoc/Writers/HTML.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 5843bc5ef..3f47c386d 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -248,14 +248,14 @@ elementToHtml opts (Sec level num id' title' elements) = do let stuff = header'' : innerContents let slide = writerSlideVariant opts /= NoSlides && level == 1 let titleSlide = slide && null elements - let attrs = [prefixedId opts id' | writerSectionDivs opts] ++ - [A.class_ "titleslide" | titleSlide] ++ - [A.class_ "slide" | slide] + let classes = ["titleslide" | titleSlide] ++ ["slide" | slide] ++ + ["level" ++ show level] let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts] + let secttag = if writerHtml5 opts + then H.section ! A.class_ (toValue $ unwords classes) + else H.div ! A.class_ (toValue $ unwords ("section":classes)) return $ if writerSectionDivs opts || slide - then if writerHtml5 opts - then foldl (!) (H.section $ inNl stuff) attrs - else foldl (!) (H.div $ inNl stuff) attrs + then secttag ! prefixedId opts id' $ inNl stuff else mconcat $ intersperse (nl opts) stuff -- | Convert list of Note blocks to a footnote
. -- cgit v1.2.3