mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-26 17:35:49 +00:00
Previously, the fix for #10578 (removing leading section break to avoid blank first page) was implemented inside blocksToOpenXML, which is called recursively for Div contents. Since makeSectionsWithOffsets wraps each section in a Div, this caused ALL section breaks to be stripped, not just the first one (#11482). This commit fixes the issue by tracking whether we've processed the first section header using a new stFirstSectionHeader state flag. Section breaks are now correctly added between chapters/parts while still avoiding a blank first page. Closes #11482. See also #10578. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>