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).

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2c3cb541-bb46-47b6-8920-d8ae1a99a518%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.