v0.1.3-headers-footers
md2pdf v0.1.3
This release introduces comprehensive page-level layout controls, including running headers, footers, and automatic pagination features.
New Features
- Running Headers and Footers: Inject custom HTML headers and footers with dynamic variables (e.g., page numbers, titles) via the CLI (
--header,--footer) or the programmatic API. - Manual Page Breaks: Force page breaks anywhere in your markdown document using standard
<!-- pagebreak -->HTML comments. - Automatic Page Breaks: Configure automatic page breaks before
h1tags orhrhorizontal rules to ensure clean section boundaries. - Dynamic Margins: Automated margin expansion to safely accommodate running headers and footers without overlapping body content.
- Metadata Propagation: Dynamic inference of PDF Creator strings and safer HTML escaping for document titles.
Bug Fixes
- Fixed an issue where custom metadata fields could overwrite fallback frontmatter unpredictably during PDF injection.
- Resolved ESM
__dirnameresolution path bugs that affected testing environments. - Resolved a bug where passing
{ enabled: false }to header/footer configurations was incorrectly evaluated as truthy. - Prevented
h1auto-page-breaks from incorrectly injecting a blank leading page at the very start of the document.
Maintenance
- Added comprehensive visual regression test fixtures for multi-page rendering and header/footer consistency.
- Removed outdated transitive types and strictly exported all internal public API interfaces (
PdfMetadata).
Full Changelog: v0.1.2...v0.1.3