aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-09-06 08:44:36 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-06 08:44:59 -0700
commit6e2cfd6c97b1b8657f1f3e2b66090a2c3ba8d887 (patch)
treea1024b399cb6bd5d0a1a7baef1dedb8960e9f7ba /src/Text/Pandoc/Shared.hs
parent345b33762eb4cc6d57d74c76c4757a6166ee5c13 (diff)
downloadpandoc-6e2cfd6c97b1b8657f1f3e2b66090a2c3ba8d887.tar.gz
Improve detection of headings in Divs by hierarchicalize.
The structure ``` <h1>one</h1> <div> <h1>two</h1> </div> ``` should create two coordinate sections, not a section with a subsection. Now it does. Extends #3057.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 949f53a3a..4dc2484e7 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -544,7 +544,8 @@ hierarchicalizeWithIds (x:rest) = do
headerLtEq :: Int -> Block -> Bool
headerLtEq level (Header l _ _) = l <= level
-headerLtEq level (Div ("",["references"],[]) (Header l _ _ : _)) = l <= level
+headerLtEq level (Div ("",classes,[]) (Header l _ _ : _)) =
+ l <= level && "column" `notElem` classes && "columns" `notElem` classes
headerLtEq _ _ = False
-- | Generate a unique identifier from a list of inlines.