diff --git a/src/main/java/w2phtml/xhtml/content/TextParser.java b/src/main/java/w2phtml/xhtml/content/TextParser.java index 6e8e871..2696e99 100644 --- a/src/main/java/w2phtml/xhtml/content/TextParser.java +++ b/src/main/java/w2phtml/xhtml/content/TextParser.java @@ -1189,12 +1189,14 @@ public class TextParser extends Parser { // Check it's master page, pageNumber, Page break before - if we already set MP - throw it away // And make a note to pass this paragraph next time you'll meet it. if (inUnreakableElement() ) { + //No breaks possible return hnode; } Integer newPageNumber = null; newPageNumber = getPageNumber(style, newPageNumber); if (currentMasterPage == null && style != null) { + //Document wasn't started yet. hnode = startDocument(hnode, style, newPageNumber); hnode = docSep.processOutlineLevel(currentNode, hnode, pageNum); } else if (hasMasterPage(style) || hasBreakBefore(style) || breakBeforeNextNode) {