aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 50947c1be..eeb3d1389 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -758,7 +758,12 @@ directive' = do
children <- case body of
"" -> block
_ -> parseFromString' parseBlocks body'
- return $ B.divWith attrs children
+ return $
+ case B.toList children of
+ [Header lev attrs' ils]
+ | T.null body -> -- # see #6699
+ B.headerWith (attrs' <> attrs) lev (B.fromList ils)
+ _ -> B.divWith attrs children
other -> do
pos <- getPosition
logMessage $ SkippedContent (".. " <> other) pos