feat(wxread): align pagination, rendering, and docs
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user