git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Fixed bug with unnumbered section headings.

Unnumbered section headings (with class 'unnumbered') were getting numbers. This commit fixes the bug.

commitf6a020a906e5b03defa9924819b7f8cf2f626277 authorJohn MacFarlane <fiddlosopher@gmail.com> dateMon 17 Feb 2014, 15:18 (13 years ago) parent56320f4
1 file changed+2−1
src/Text/Pandoc/Writers/HTML.hs+2−1
src/Text/Pandoc/Writers/HTML.hs+2−1
@@ -475,10 +475,11 @@ blockToHtml opts (BlockQuote blocks) =
475475 else do
476476 contents <- blockListToHtml opts blocks
477477 return $ H.blockquote $ nl opts >> contents >> nl opts
478−blockToHtml opts (Header level (_,_,_) lst) = do
478+blockToHtml opts (Header level (_,classes,_) lst) = do
479479 contents <- inlineListToHtml opts lst
480480 secnum <- liftM stSecNum get
481481 let contents' = if writerNumberSections opts && not (null secnum)
482+ && "unnumbered" `notElem` classes
482483 then (H.span ! A.class_ "header-section-number" $ toHtml
483484 $ showSecNum secnum) >> strToHtml " " >> contents
484485 else contents