Skip to content

v4.0.0

Latest

Choose a tag to compare

@caring-coder caring-coder released this 14 Nov 04:21
· 6 commits to main since this release

=== Breaking Changes

  • Section Comments Removed: The dead // section {...} comments the DOCX→AsciiDoc converter used to emit are gone. Section layout is now carried by the machine-readable [section-properties] block, emitted by default; callers that do not verify those values can restore the minimal output with toAsciidoc(pkg, skipComments, false). Test pins capturing section layout as comments must be migrated.

=== New Features

  • Section Round-trip: The DOCX→AsciiDoc converter now reconstructs the standalone [section] marker from a document's section breaks, so an AsciiDoc→DOCX→AsciiDoc round-trip is a fixed point. Each section's own [header]/[footer] blocks are emitted at the start of that section's span — right after its [section] marker — instead of collecting all headers at the top and all footers at the document end, which rebound them to the wrong section on re-conversion. Empty header/footer parts are preserved, keeping the empty blocks that break inheritance.
  • Section Properties: A new span-scoped [section-properties] block declares a section's layout — page size, margins, orientation, columns (including per-column widths), document grid, break type, different-first-page, page borders, and right-to-left layout — bound like [header]/[footer] to the section whose span it appears in. The DOCX→AsciiDoc converter emits it for every section (replacing the old dead // section {...} comment), so page setup round-trips losslessly; this emission can be disabled for tests that do not verify those values (toAsciidoc(pkg, skipComments, false)). Property values accept two equivalent formats, usable freely and mixable: nested brace maps (pgSz={w=11906, h=16838}) and dotted paths (pgSz.w=11906, pgSz.h=16838).
  • Header/Footer Kinds: First-page and even-page header/footer parts are now emitted with their proper block roles ([header-first], [footer-even], …) and rebind to the correct reference kind on re-conversion. Section ownership is decided from the section's own header/footer references, so docx4j's auto-created empty parts for titlePg sections are no longer emitted as stray blocks.

=== Improvements and Fixes

  • Text Rendering: Delimited blocks ([header], [footer], quotes, etc.) no longer emit a blank line inside their closing delimiter, so rendered text matches its AsciiDoc source form exactly.