a796b655cd
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.
170 lines
2.2 KiB
Markdown
170 lines
2.2 KiB
Markdown
```
|
|
% 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>
|
|
```
|