From 717767ddd113640969335d040971ded30bf3970c Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 8 Dec 2009 06:53:37 +0000 Subject: 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 --- src/Text/Pandoc/Writers/HTML.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Text') 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 "", + showSecNum num, HtmlInline "", 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 "", + showSecNum num, HtmlInline "", Space] ++ + title' else title' header' <- blockToHtml opts (Header level title'') return $ if writerS5 opts || (writerStrictMarkdown opts && not (writerTableOfContents opts)) -- cgit v1.2.3