From 2b1c69e85eb80ff54b34f7f044cf2449699f4e88 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Sun, 21 Nov 2021 15:48:57 +0100 Subject: [PATCH] fix: add spb before list if spb located before first list item content --- src/main/java/w2phtml/pageSplitters/ListSplitter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/w2phtml/pageSplitters/ListSplitter.java b/src/main/java/w2phtml/pageSplitters/ListSplitter.java index 20fe791..e4413b2 100644 --- a/src/main/java/w2phtml/pageSplitters/ListSplitter.java +++ b/src/main/java/w2phtml/pageSplitters/ListSplitter.java @@ -60,9 +60,14 @@ public class ListSplitter extends BasicSplitter implements ISplitter { } else { list.removeChild(child); } + } else { + //Debug.printNode(child); + //Found SPB at start of the list + //Add SPB before the list + if (isRootElement(list)) { + parent.insertBefore(softPageBreak, list); + } } - // Debug.printNode(child); - break; } else { // Not with SPB yet, move node, set dataMoved=true