summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-10-02 23:19:03 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-10-02 23:19:03 -0700
commitc335b6cbd8e73537f6482ffc127bb428f586602e (patch)
treec9765dfc9c721c3757fb6d2c3b4563ca014475f0 /src/Text/Pandoc/Writers/HTML.hs
parent06054ff740eabf164af164b9d7ef0fa112fc382a (diff)
HTML slides: only add id to div/section if --section-divs selected.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 6bc911fbd..5550db105 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -237,15 +237,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 classes = [theclass "titleslide" | titleSlide] ++
- [theclass "slide" | slide]
+ let attrs = [prefixedId opts id' | writerSectionDivs opts] ++
+ [theclass "titleslide" | titleSlide] ++
+ [theclass "slide" | slide]
let inNl x = nl opts : intersperse (nl opts) x ++ [nl opts]
return $ if writerSectionDivs opts || slide
then if writerHtml5 opts
- then tag "section" ! (prefixedId opts id' : classes)
- << inNl stuff
- else thediv ! (prefixedId opts id' : classes)
- << inNl stuff
+ then tag "section" ! attrs << inNl stuff
+ else thediv ! attrs << inNl stuff
else toHtmlFromList $ intersperse (nl opts) stuff
-- | Convert list of Note blocks to a footnote <div>.