diff options
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 32a3b853b..acd68300a 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -630,7 +630,8 @@ blockToHtml opts (LineBlock lns) = htmlLines <- inlineListToHtml opts $ intercalate [LineBreak] lns return $ H.div ! A.class_ "line-block" $ htmlLines blockToHtml opts (Div (ident, "section":dclasses, dkvs) - (Header level hattr ils : xs)) = do + (Header level + hattr@(hident,hclasses,hkvs) ils : xs)) = do slideVariant <- gets stSlideVariant slideLevel <- gets stSlideLevel let slide = slideVariant /= NoSlides && @@ -684,7 +685,9 @@ blockToHtml opts (Div (ident, "section":dclasses, dkvs) else id) $ t <> if null innerSecs then mempty else nl opts <> innerContents - else if writerSectionDivs opts || slide || not (null dclasses) + else if writerSectionDivs opts || slide || + (hident /= ident && not (T.null hident || T.null ident)) || + (hclasses /= dclasses) || (hkvs /= dkvs) then addAttrs opts attr $ secttag $ nl opts <> header' <> nl opts <> |