diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index e234b7fca..0b99c6c92 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -274,17 +274,17 @@ blockToHtml opts (Header level lst) = do let attribs = if writerStrictMarkdown opts && not (writerTableOfContents opts) then [] else [identifier id] - let headerHtml = case level of - 1 -> h1 contents ! attribs - 2 -> h2 contents ! attribs - 3 -> h3 contents ! attribs - 4 -> h4 contents ! attribs - 5 -> h5 contents ! attribs - 6 -> h6 contents ! attribs - _ -> paragraph contents ! attribs - return $ if writerTableOfContents opts - then anchor ! [href ("#TOC-" ++ id)] $ headerHtml - else headerHtml + let contents' = if writerTableOfContents opts + then anchor ! [href ("#TOC-" ++ id)] $ contents + else contents + return $ case level of + 1 -> h1 contents' ! attribs + 2 -> h2 contents' ! attribs + 3 -> h3 contents' ! attribs + 4 -> h4 contents' ! attribs + 5 -> h5 contents' ! attribs + 6 -> h6 contents' ! attribs + _ -> paragraph contents' ! attribs blockToHtml opts (BulletList lst) = do contents <- mapM (blockListToHtml opts) lst let attribs = if writerIncremental opts |