aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-12-21 12:26:29 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-12-21 12:26:29 -0800
commiteca39d6cf1e97c81564c2f69881733271cfe01a6 (patch)
tree2405bc8b9ecc16517264557cf10f3fd74024a7c4 /src
parent80a0e56a5dba0c1befcf46a2621efcfea18256b3 (diff)
downloadpandoc-eca39d6cf1e97c81564c2f69881733271cfe01a6.tar.gz
HTML writer: more tweaks to avoid round-trip failures...
having to do with makeSections.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs7
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 <>