Releases: rupor-github/fb2cng
v1.3.2
Improvements: KFX dropcap layout in Kindle Previewer / Kindle rendering.
- Removed the previous narrow no-break space (U+202F) workaround after the dropcap character.
- Preserved normal dropcap styling, including:
- dropcap-lines
- dropcap-chars
- first-letter glyph styling
- CSS styling such as bold and letter spacing
- Improved dropcap behavior with negative horizontal margins:
- fb2cng now wraps affected dropcap paragraphs in an internal margin wrapper.
- The wrapper keeps the book/page horizontal inset.
- The inner dropcap paragraph avoids negative horizontal margins that break KP3 layout.
- Fixed unwanted spacing after dropcap paragraphs by zeroing their KFX bottom margin.
Full Changelog: v1.3.1...v1.3.2
v1.3.1
New features:
- Added legacy OPF2 cover metadata to EPUB3 output for Apple Books compatibility.
- EPUB3 now emits both:
- meta name="cover" content="book-cover-image"
- properties="cover-image" on the actual cover image manifest item.
- The legacy cover meta points directly to the raster cover image, while cover.xhtml continues to use the SVG wrapper.
- Added EPUB3 OPF test coverage for the Apple-compatible cover metadata.
- EPUB3 now emits both:
- Added configurable device TOC nesting via document.toc_type.
- Supported TOC types:
- normal — preserve full section nesting.
- old_kindle — restrict nesting for old Kindle/kindlegen compatibility.
- flat — make navigation entries top-level siblings.
- Kept generated visible TOC pages unchanged for EPUB2, EPUB3, and KFX.
- Removed presentation classes from EPUB3 nav.xhtml.
- Added shared TOC shaping helper and tests.
- Added regression tests for normal, old_kindle, and flat nesting in EPUB2, EPUB3, and KFX.
- Supported TOC types:
Full Changelog: v1.3.0...v1.3.1
v1.3.0
New features
- Added KFX html/body root style handling with inherited root properties, descendant selectors, and horizontal root margins.
Bug fixes
- Fixed backlink style events to use inline delta styling so margins and block properties do not affect backlink rendering.
- Fixed KFX title width handling with negative root margins.
- Prevented root horizontal margins from being reapplied to nested title children.
- Fixed title inline images being oversized by avoiding heading-font scaling for title art.
- Added regression tests for title child margins and fixed-size title inline images.
Full Changelog: v1.2.8...v1.3.0
v1.2.8
v1.2.7
EPUB Cover Improvements
- Fixed generated cover.xhtml CSS typo (height was misspelled), improving cover page sizing for EPUB2 and EPUB3.
- Added EPUB3 structural semantics to cover pages:
- xmlns:epub namespace declaration
- epub:type="cover" on the cover page
- Improved cover accessibility by adding SVG text alternatives:
- <title> uses FB2 cover image alt text when available, otherwise Cover
- uses Cover image for when available
- Added tests for EPUB3 cover semantics and SVG accessibility text.
- Validated generated EPUB2 and EPUB3 files with EPUBCheck; no errors or warnings.
Maintenance
- Updated dependencies
- Removed minisign and simplified action pipeline
- Updated external data download tasks:
- Switched TeX hyphenation dictionary download from legacy CTAN directory scraping to hyphenation-utf8.zip via mirrors.ctan.org.
- Updated dictionary setup notes accordingly.
- Strengthened Taskfile status checks for dictionary and sentence model downloads to detect partial/incomplete data sets.
Full Changelog: v1.2.6...v1.2.7
v1.2.3
New features
- Floating footnotes now show the
moreindicator based on visible content, not just extra paragraphs.- EPUB2/Kepub, EPUB3, and KFX now treat images and tables as additional footnote content, preserve correct marker placement, and handle image- or table-first footnotes consistently.
Maintenance
- Moving to go1.26.2 with full dependencies update
Full Changelog: v1.2.2...v1.2.3
v1.2.2
Bug fixes
-
Fix missing navigation TOC for untitled wrapper sections
- When an FB2 file has a top-level
<section>with no<title>(a wrapper section containing titled subsections), all chapter entries were silently dropped from the navigation TOC. The skip logic for untitled entries discarded their children instead of promoting them to the parent level. - Fixed in both EPUB (NCX, nav.xhtml, TOC page) and KFX/AZW8 (book_navigation, TOC page) output paths.
- When an FB2 file has a top-level
-
Fix vignette and heading treatment for FB2 files with untitled wrapper sections
- Introduce
titleDepth— a visual depth counter that only increments when entering a titled<section>, separate from the structuraldepthwhich always increments. This ensures that titled children of an untitled wrapper get chapter-level treatment (h1, chapter vignettes,chapter-titleCSS class) instead of being demoted to section-level. - EPUB: add
titleDepthtosplitResult,appendSectionContent,appendFlowItems, andrenderSplitSection. All visual decisions (vignette position, heading level, wrapper class) now usetitleDepth. - KFX: add
titleDepthtosectionWorkItemandprocessStorylineSectionContent. End-vignette and title-wrapper logic usestitleDepthfor the chapter-vs-section distinction. FixisChapterEndpropagation so untitled wrapper parents pass it to all children (each is an independent chapter), not only the last.
- Introduce
Full Changelog: v1.2.1...v1.2.2
v1.2.1
Bug fixes
- Fixed EPUB generation dropping paragraph content from malformed FB2 files where
<p>elements are nested inside other<p>elements. Previously only the last inner paragraph of each chapter was preserved; now all paragraphs are correctly recovered as separate blocks. - Added defense-in-depth fix to the XHTML renderer to prevent text overwrites in edge cases with deeply nested malformations.
Full Changelog: v1.2.0...v1.2.1
v1.2.0
KFX Style Fixes
Bug Fixes
-
sub/sup/small in headings: User CSS for
<sub>,<sup>, and<small>elements was lost inside heading contexts (h1-h6) due to cascade override, missing baseline_style conversion, lack of style propagation to heading descendants, font-family normalization stripping inline styles, and missing paragraph context in title processing. -
Font-size computation for em units in headings: Added
RemToFontSizeMultiplier()to recover the original CSS multiplier from compressed rem values, enabling correct em-unit accumulation through nested inline elements inside headings. -
CSS class/tag name collision: Class-only selectors matching HTML tag names (e.g.,
.h1vsh1) collided inselectorStyleName(). Class selectors that collide are now prefixed with".". -
h1 font-size: Changed h1 default from 2.0rem to 1.5rem to match KP3's HTML5 section-depth-1 behavior (h1 inside a section is 1.5em, not 2.0em).
-
Inline images inside links: Links wrapping inline images (both cross-references and footnotes) incorrectly received an empty style instead of the proper link style (underline, superscript, etc.). Removed the wrong
linkHasImagespecial case — KP3 applies identical styling regardless of link content.
Cleanup
- Spurious DEBUG logs: Eliminated noisy log messages for pseudo-element rules (
::before/::aftercontent) anddisplay: noneby handling them before they reach the ignorable-pattern filter.
Full Changelog: v1.1.10...v1.2.0
v1.1.10
Bug fixes and maintenance
- Fix KFX section splitting to honor CSS
page-break-before: alwayson.section-title-hN, matching EPUB behavior. - Replace the previous hardcoded depth-2 KFX split rule with stylesheet-driven section break handling.
- Add tests covering selective depth-based KFX section splitting and related vignette behavior.
- Dependencies update
Full Changelog: v1.1.9...v1.1.10