diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-12-05 09:17:28 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-12-05 09:17:28 -0800 |
commit | 4489283b03fecce31c49f37809932cebb8b72d46 (patch) | |
tree | 7987ebbb4d3de6ed48b3cdb68256b274eba5c9d8 | |
parent | 28a2a6e5345f2dc51632bdd3ca2b063cc08d896d (diff) | |
download | pandoc-4489283b03fecce31c49f37809932cebb8b72d46.tar.gz |
Fix makeSections so it doesn't turn column divs into sections.
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 4 | ||||
-rw-r--r-- | test/command/make-section-column-divs.md | 28 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 926116e23..efb2e56dd 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -586,7 +586,9 @@ makeSections numbering mbBaseLevel bs = (Header level (ident,classes,kvs) title':ys) : xs) | all (\case Header level' _ _ -> level' > level - _ -> True) ys = do + _ -> True) ys + , "column" `notElem` dclasses + , "columns" `notElem` dclasses = do inner <- go (Header level (ident,classes,kvs) title':ys) let inner' = case inner of diff --git a/test/command/make-section-column-divs.md b/test/command/make-section-column-divs.md new file mode 100644 index 000000000..0e8548233 --- /dev/null +++ b/test/command/make-section-column-divs.md @@ -0,0 +1,28 @@ +For reference see +https://groups.google.com/d/msgid/pandoc-discuss/cef24253-7731-417c-a1ee-48153c4344bf%40googlegroups.com + +``` +% pandoc +::: columns +::: column +# A + +a +::: +::: column +# B + +b +::: +::: +^D +<div class="columns"> +<div class="column"> +<h1 id="a">A</h1> +<p>a</p> +</div><div class="column"> +<h1 id="b">B</h1> +<p>b</p> +</div> +</div> +``` |