feat(wxread): align pagination, rendering, and docs

This commit is contained in:
shen
2026-05-24 15:36:01 +08:00
parent a318c0e3d0
commit 2a94921e88
103 changed files with 6124 additions and 4623 deletions
@@ -812,6 +812,8 @@ enum RDEPUBTextRendererSupport {
return .attachment
}
switch tagName {
case "h1", "h2", "h3", "h4", "h5", "h6":
return .generic
case "blockquote":
return .blockquote
case "ul", "ol", "li":
@@ -849,6 +851,16 @@ enum RDEPUBTextRendererSupport {
["blockquote", "pre", "code", "table", "ul", "ol", "figure", "img"].contains(tagName) {
hints.append(.avoidPageBreakInside)
}
if ["h1", "h2", "h3", "h4", "h5", "h6"].contains(tagName) ||
rawTag.contains("subhead") ||
rawTag.contains("firsttitle") ||
rawTag.contains("secondtitle") ||
rawTag.contains("thirdtitle") ||
rawTag.contains("fourthtitle") ||
rawTag.contains("fifthtitle") ||
rawTag.contains("sixthtitle") {
hints.append(.keepWithNext)
}
if rawTag.contains("pagebreakbefore") ||
rawTag.contains("page-break-before: always") ||
rawTag.contains("break-before: page") {