@@ -201,10 +201,12 @@ tableOfContents opts sects = do
201201 then Nothing
202202 else Just $
203203 if writerHtml5 opts
204− then tag "nav" ! [prefixedId opts' "TOC"] $
205− nl opts +++ unordList opts tocList
206− else thediv ! [prefixedId opts' "TOC"] $
207− nl opts +++ unordList opts tocList
204+ then (tag "nav" ! [prefixedId opts' "TOC"] $
205+ nl opts +++ unordList opts tocList +++ nl opts)
206+ +++ nl opts
207+ else (thediv ! [prefixedId opts' "TOC"] $
208+ nl opts +++ unordList opts tocList +++ nl opts)
209+ +++ nl opts
208210
209211-- | Convert section number to string
210212showSecNum :: [Int] -> String
@@ -254,8 +256,9 @@ footnoteSection :: WriterOptions -> [Html] -> Html
254256footnoteSection opts notes =
255257 if null notes
256258 then noHtml
257− else thediv ! [theclass "footnotes"]
258− $ nl opts +++ hr +++ nl opts +++ olist << (notes ++ [nl opts])
259+ else nl opts +++ (thediv ! [theclass "footnotes"]
260+ $ nl opts +++ hr +++ nl opts +++
261+ (olist << (notes ++ [nl opts])) +++ nl opts)
259262
260263
261264-- | Parse a mailto link; return Just (name, domain) or Nothing.
@@ -317,14 +320,9 @@ attrsToHtml opts (id',classes',keyvals) =
317320
318321-- | Convert Pandoc block element to HTML.
319322blockToHtml :: WriterOptions -> Block -> State WriterState Html
320−blockToHtml opts b@(Plain _) = blockToHtml' opts b
321−blockToHtml opts b@(RawBlock _ _) = blockToHtml' opts b
322−blockToHtml opts b = blockToHtml' opts b >>= return . (nl opts +++)
323−
324−blockToHtml' :: WriterOptions -> Block -> State WriterState Html
325−blockToHtml' _ Null = return noHtml
326−blockToHtml' opts (Plain lst) = inlineListToHtml opts lst
327−blockToHtml' opts (Para [Image txt (s,tit)]) = do
323+blockToHtml _ Null = return noHtml
324+blockToHtml opts (Plain lst) = inlineListToHtml opts lst
325+blockToHtml opts (Para [Image txt (s,tit)]) = do
328326 img <- inlineToHtml opts (Image txt (s,tit))
329327 capt <- inlineListToHtml opts txt
330328 return $ if writerHtml5 opts
@@ -333,13 +331,13 @@ blockToHtml' opts (Para [Image txt (s,tit)]) = do
333331 else thediv ! [theclass "figure"] <<
334332 [nl opts, img, paragraph ! [theclass "caption"] << capt,
335333 nl opts]
336−blockToHtml' opts (Para lst) = do
334+blockToHtml opts (Para lst) = do
337335 contents <- inlineListToHtml opts lst
338336 return $ paragraph contents
339−blockToHtml' _ (RawBlock "html" str) = return $ primHtml str
340−blockToHtml' _ (RawBlock _ _) = return noHtml
341−blockToHtml' _ (HorizontalRule) = return hr
342−blockToHtml' opts (CodeBlock (id',classes,keyvals) rawCode) = do
337+blockToHtml _ (RawBlock "html" str) = return $ primHtml str
338+blockToHtml _ (RawBlock _ _) = return noHtml
339+blockToHtml _ (HorizontalRule) = return hr
340+blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
343341 let classes' = if writerLiterateHaskell opts
344342 then classes
345343 else filter (/= "literate") classes
@@ -356,7 +354,7 @@ blockToHtml' opts (CodeBlock (id',classes,keyvals) rawCode) = do
356354 [stringToHtml $ addBird rawCode'])
357355 Right h -> modify (\st -> st{ stHighlighting = True }) >>
358356 return h
359−blockToHtml' opts (BlockQuote blocks) =
357+blockToHtml opts (BlockQuote blocks) =
360358 -- in S5, treat list in blockquote specially
361359 -- if default is incremental, make it nonincremental;
362360 -- otherwise incremental
@@ -373,7 +371,7 @@ blockToHtml' opts (BlockQuote blocks) =
373371 else do
374372 contents <- blockListToHtml opts blocks
375373 return $ blockquote contents
376−blockToHtml' opts (Header level lst) = do
374+blockToHtml opts (Header level lst) = do
377375 contents <- inlineListToHtml opts lst
378376 secnum <- liftM stSecNum get
379377 let contents' = if writerNumberSections opts
@@ -391,13 +389,13 @@ blockToHtml' opts (Header level lst) = do
391389 5 -> h5 contents''
392390 6 -> h6 contents''
393391 _ -> paragraph contents'')
394−blockToHtml' opts (BulletList lst) = do
392+blockToHtml opts (BulletList lst) = do
395393 contents <- mapM (blockListToHtml opts) lst
396394 let attribs = if writerIncremental opts
397395 then [theclass "incremental"]
398396 else []
399397 return $ (unordList opts contents) ! attribs
400−blockToHtml' opts (OrderedList (startnum, numstyle, _) lst) = do
398+blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
401399 contents <- mapM (blockListToHtml opts) lst
402400 let numstyle' = camelCaseToHyphenated $ show numstyle
403401 let attribs = (if writerIncremental opts
@@ -420,7 +418,7 @@ blockToHtml' opts (OrderedList (startnum, numstyle, _) lst) = do
420418 numstyle']
421419 else [])
422420 return $ (ordList opts contents) ! attribs
423−blockToHtml' opts (DefinitionList lst) = do
421+blockToHtml opts (DefinitionList lst) = do
424422 contents <- mapM (\(term, defs) ->
425423 do term' <- liftM (dterm <<) $ inlineListToHtml opts term
426424 defs' <- mapM ((liftM (\x -> ddef << (x +++ nl opts))) .
@@ -430,7 +428,7 @@ blockToHtml' opts (DefinitionList lst) = do
430428 then [theclass "incremental"]
431429 else []
432430 return $ dlist ! attribs << (concat contents +++ nl opts)
433−blockToHtml' opts (Table capt aligns widths headers rows') = do
431+blockToHtml opts (Table capt aligns widths headers rows') = do
434432 captionDoc <- if null capt
435433 then return noHtml
436434 else inlineListToHtml opts capt >>= return . caption