aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-08 06:53:37 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-08 06:53:37 +0000
commit717767ddd113640969335d040971ded30bf3970c (patch)
treefd5e5e9272528ff7f92026a66762a59ec44c0963 /src/Text
parent2ced785e95e0799f3c8a705e828e6522e11a8a98 (diff)
downloadpandoc-717767ddd113640969335d040971ded30bf3970c.tar.gz
Provide CSS hooks for section numbers in headers and TOC entries.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1659 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 56398b263..67d6690c8 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -166,7 +166,9 @@ elementToListItem :: WriterOptions -> Element -> State WriterState (Maybe Html)
elementToListItem _ (Blk _) = return Nothing
elementToListItem opts (Sec _ num id' headerText subsecs) = do
let headerText' = if writerNumberSections opts
- then showSecNum num : Space : headerText
+ then [HtmlInline "<span class=\"toc-section-number\">",
+ showSecNum num, HtmlInline "</span>", Space] ++
+ headerText
else headerText
txt <- inlineListToHtml opts headerText'
subHeads <- mapM (elementToListItem opts) subsecs >>= return . catMaybes
@@ -181,7 +183,9 @@ elementToHtml opts (Blk block) = blockToHtml opts block
elementToHtml opts (Sec level num id' title' elements) = do
innerContents <- mapM (elementToHtml opts) elements
let title'' = if writerNumberSections opts
- then showSecNum num : Space : title'
+ then [HtmlInline "<span class=\"header-section-number\">",
+ showSecNum num, HtmlInline "</span>", Space] ++
+ title'
else title'
header' <- blockToHtml opts (Header level title'')
return $ if writerS5 opts || (writerStrictMarkdown opts && not (writerTableOfContents opts))