mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 17:20:47 +08:00
Shared: Improve makeSections.
Previously it would sometimes create doubled section divs. By leaving the inner heading's id on the heading itself, and then consolidating the inner and outer section divs, we can avoid this undesirable result. Closes #11745.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
```
|
||||
% pandoc --section-divs
|
||||
# Book Title
|
||||
|
||||
::: {#ch1 .section}
|
||||
## Chapter 1
|
||||
Hello world.
|
||||
:::
|
||||
|
||||
::: {#ch2 .section}
|
||||
## Chapter 2
|
||||
Goodbye world.
|
||||
:::
|
||||
^D
|
||||
<section id="book-title" class="level1">
|
||||
<h1>Book Title</h1>
|
||||
<section id="ch1" class="level2">
|
||||
<h2 id="chapter-1">Chapter 1</h2>
|
||||
<p>Hello world.</p>
|
||||
</section>
|
||||
<section id="ch2" class="level2">
|
||||
<h2 id="chapter-2">Chapter 2</h2>
|
||||
<p>Goodbye world.</p>
|
||||
</section>
|
||||
</section>
|
||||
```
|
||||
Reference in New Issue
Block a user