125续15l-7j 修: 成书封页改走findSemanticCut语义切点(旧版硬切380劈句子吞内容), 残句续下一页
Auto Release / build (push) Successful in 4m17s
Auto Release / build (push) Successful in 4m17s
This commit is contained in:
@@ -382,12 +382,14 @@ public class CustomScreenManager implements Listener {
|
||||
|
||||
java.util.List<String> pages = new java.util.ArrayList<>();
|
||||
|
||||
// ★ 15l-7i 封页补肉:正文前 ~380 字直接进封页(不单独放标题行)
|
||||
// ★ 15l-7j 封页补肉:正文前 ~380 字进封页,但必须在语义边界(。!?;\n)处切,
|
||||
// 残句续下一页(与正文分页同一套 findSemanticCut 切法)。
|
||||
// 旧 bug:封页硬切 body.substring(0,380) 劈句子(「投票规则详见…未在投票有效期内」
|
||||
// 被吞进剩余 body 的第一段,导致第2页开头是残缺句「参与表决的,视为自动弃权」)。
|
||||
if (!body.isEmpty()) {
|
||||
int target = 380;
|
||||
int consumed = Math.min(body.length(), target);
|
||||
pages.add(body.substring(0, consumed));
|
||||
body = body.substring(consumed);
|
||||
int cut = findSemanticCut(body, 380);
|
||||
pages.add(body.substring(0, cut));
|
||||
body = body.substring(cut);
|
||||
}
|
||||
|
||||
if (!body.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user