I’m trying to write a book in pandoc markdown, but I’m having an issue with --section-divs to enclose each matter in a definite block with its own id.
Suppose a markdown document like this
<header id="frontmatter">
## Introduction
…
</header>
<article id="bodymatter">
# Chapter I
…
#Chapter II
…
</article>
<footer id="backmatter">
# Appendix A
…
# Appendix B
</footer>
If used with --section-divs, the section opened by the previous heading won’t close until the next heading. Resulting in something like (assuming -t html5)
<header id="frontmatter">
<section class="level2">
<h2>Introduction</h2>
…
</header>
<article id="bodymatter">
</section>
<section class="level1">
<h1>Chapter I</h1>
…
Is there a way to tell pandoc to close all pending <section> before another header?
Or for pandoc to recognize <header>, <main>, <article>, <footer> as containers so it closes the sections when finding </header>, </main>, </article>, </footer>? (before those closing tags, of course).