aboutsummaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-10-29 21:24:58 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-10-29 21:24:58 -0700
commita796b655cd2046c1297d800e328ed9ef58251405 (patch)
tree10cf4d835aa54db0e0db9b378994f4c9bd3e7043 /test/command
parent47566817c559557f5bc6c9c503afa1a37bf7df90 (diff)
downloadpandoc-a796b655cd2046c1297d800e328ed9ef58251405.tar.gz
Shared.makeSections: better behavior in some corner cases.
When a div surrounds multiple sections at the same level, or a section of highre level followed by one of lower level, then we just leave it as a div and create a new div for the section. Closes #5846, closes #5761.
Diffstat (limited to 'test/command')
-rw-r--r--test/command/5846.md170
1 files changed, 170 insertions, 0 deletions
diff --git a/test/command/5846.md b/test/command/5846.md
new file mode 100644
index 000000000..ec00074d3
--- /dev/null
+++ b/test/command/5846.md
@@ -0,0 +1,170 @@
+```
+% pandoc --section-divs
+::: {.mydiv}
+# header 1a
+
+one
+
+# header 1b
+
+two
+:::
+^D
+<div class="mydiv">
+<section id="header-1a" class="level1">
+<h1>header 1a</h1>
+<p>one</p>
+</section>
+<section id="header-1b" class="level1">
+<h1>header 1b</h1>
+<p>two</p>
+</section>
+</div>
+```
+
+```
+% pandoc --section-divs
+::: mydiv
+# head 1
+## head 1.1
+# head 2
+:::
+
+## head 2.1
+^D
+<div class="mydiv">
+<section id="head-1" class="level1">
+<h1>head 1</h1>
+<section id="head-1.1" class="level2">
+<h2>head 1.1</h2>
+</section>
+</section>
+<section id="head-2" class="level1">
+<h1>head 2</h1>
+</section>
+</div>
+<section id="head-2.1" class="level2">
+<h2>head 2.1</h2>
+</section>
+```
+
+```
+% pandoc --section-divs
+# One
+## One A
+::: fence
+## One B
+# Two
+:::
+^D
+<section id="one" class="level1">
+<h1>One</h1>
+<section id="one-a" class="level2">
+<h2>One A</h2>
+</section>
+<div class="fence">
+<section id="one-b" class="level2">
+<h2>One B</h2>
+</section>
+<section id="two" class="level1">
+<h1>Two</h1>
+</section>
+</div>
+</section>
+```
+
+```
+% pandoc --section-divs
+# Beginning
+
+::: exterior
+
+At first...
+
+:::
+
+In the beginning...
+
+::: interior
+
+# Middle
+
+So it continued...
+
+:::
+
+# Ending
+
+::: exterior
+
+And finally...
+
+:::
+^D
+<section id="beginning" class="level1">
+<h1>Beginning</h1>
+<div class="exterior">
+<p>At first…</p>
+</div>
+<p>In the beginning…</p>
+</section>
+<section id="middle" class="level1 interior">
+<h1>Middle</h1>
+<p>So it continued…</p>
+</section>
+<section id="ending" class="level1">
+<h1>Ending</h1>
+<div class="exterior">
+<p>And finally…</p>
+</div>
+</section>
+```
+
+```
+% pandoc --section-divs
+::: part
+# One
+# Two
+:::
+::: part
+# Three
+# Four
+# Five
+:::
+::: part
+# Six
+# Seven
+# Eight
+:::
+^D
+<div class="part">
+<section id="one" class="level1">
+<h1>One</h1>
+</section>
+<section id="two" class="level1">
+<h1>Two</h1>
+</section>
+</div>
+<div class="part">
+<section id="three" class="level1">
+<h1>Three</h1>
+</section>
+<section id="four" class="level1">
+<h1>Four</h1>
+</section>
+<section id="five" class="level1">
+<h1>Five</h1>
+</section>
+</div>
+<div class="part">
+<section id="six" class="level1">
+<h1>Six</h1>
+</section>
+<section id="seven" class="level1">
+<h1>Seven</h1>
+</section>
+<section id="eight" class="level1">
+<h1>Eight</h1>
+</section>
+</div>
+```