@@ -630,7 +630,8 @@ blockToHtml opts (LineBlock lns) =
630630 htmlLines <- inlineListToHtml opts $ intercalate [LineBreak] lns
631631 return $ H.div ! A.class_ "line-block" $ htmlLines
632632blockToHtml opts (Div (ident, "section":dclasses, dkvs)
633− (Header level hattr ils : xs)) = do
633+ (Header level
634+ hattr@(hident,hclasses,hkvs) ils : xs)) = do
634635 slideVariant <- gets stSlideVariant
635636 slideLevel <- gets stSlideLevel
636637 let slide = slideVariant /= NoSlides &&
@@ -684,7 +685,9 @@ blockToHtml opts (Div (ident, "section":dclasses, dkvs)
684685 else id) $ t <> if null innerSecs
685686 then mempty
686687 else nl opts <> innerContents
687− else if writerSectionDivs opts || slide || not (null dclasses)
688+ else if writerSectionDivs opts || slide ||
689+ (hident /= ident && not (T.null hident || T.null ident)) ||
690+ (hclasses /= dclasses) || (hkvs /= dkvs)
688691 then addAttrs opts attr
689692 $ secttag
690693 $ nl opts <> header' <> nl opts <>