Files
designcraft/crates
storybored379andClaude Opus 5.5 8d0203a2d2 EPUB: styles whose names slug alike keep their own CSS classes
Paragraph and character styles become CSS classes through slug(), which
keeps only ASCII letters and digits. Different styles could therefore get
the same class: every all-non-ASCII name ("見出し", "本文", Cyrillic,
Greek…) becomes `basic`, and "Body Text" / "Body-Text" / "body text" all
become `body-text`. style.css then holds several rules for one class and
the last one wins, so e.g. a 30 pt centred Japanese heading style came
out at the body style's 10 pt, left-aligned, in the EPUB.

Map each style name to a class once per export (paragraph and character
styles separately), adding -2, -3… on a collision, and use that map for
both the stylesheet and the XHTML. A class set in Export Tagging still
takes precedence in the XHTML, as before.

Test: styles_whose_names_slug_alike_keep_their_own_classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 09:52:37 -04:00
..
2026-10-04 02:47:55 -04:00
2026-10-04 02:47:55 -04:00
2026-10-04 02:47:55 -04:00