git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: put anchors around contents of headers, not around

the header tags themselves, when producing backlinks to TOC. Resolves Issue #23. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1000 788f1e2b-df1e-0410-8736-df70ead52e1b

commit4f3ad778ba3bff7984a1fee617efefbfd5591068 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 2 Sep 2007, 17:22 (19 years ago) parentfcdbb7b
1 file changed+11−11
src/Text/Pandoc/Writers/HTML.hs+11−11
src/Text/Pandoc/Writers/HTML.hs+11−11
@@ -274,17 +274,17 @@ blockToHtml opts (Header level lst) = do
274274 let attribs = if writerStrictMarkdown opts && not (writerTableOfContents opts)
275275 then []
276276 else [identifier id]
277− let headerHtml = case level of
278− 1 -> h1 contents ! attribs
279− 2 -> h2 contents ! attribs
280− 3 -> h3 contents ! attribs
281− 4 -> h4 contents ! attribs
282− 5 -> h5 contents ! attribs
283− 6 -> h6 contents ! attribs
284− _ -> paragraph contents ! attribs
285− return $ if writerTableOfContents opts
286− then anchor ! [href ("#TOC-" ++ id)] $ headerHtml
287− else headerHtml
277+ let contents' = if writerTableOfContents opts
278+ then anchor ! [href ("#TOC-" ++ id)] $ contents
279+ else contents
280+ return $ case level of
281+ 1 -> h1 contents' ! attribs
282+ 2 -> h2 contents' ! attribs
283+ 3 -> h3 contents' ! attribs
284+ 4 -> h4 contents' ! attribs
285+ 5 -> h5 contents' ! attribs
286+ 6 -> h6 contents' ! attribs
287+ _ -> paragraph contents' ! attribs
288288blockToHtml opts (BulletList lst) = do
289289 contents <- mapM (blockListToHtml opts) lst
290290 let attribs = if writerIncremental opts