@@ -758,7 +758,12 @@ directive' = do
758758 children <- case body of
759759 "" -> block
760760 _ -> parseFromString' parseBlocks body'
761− return $ B.divWith attrs children
761+ return $
762+ case B.toList children of
763+ [Header lev attrs' ils]
764+ | T.null body -> -- # see #6699
765+ B.headerWith (attrs' <> attrs) lev (B.fromList ils)
766+ _ -> B.divWith attrs children
762767 other -> do
763768 pos <- getPosition
764769 logMessage $ SkippedContent (".. " <> other) pos