From fcce0d14d6046948e723f1de2694fa386fbfeca7 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Tue, 31 Jul 2018 13:23:38 +0300 Subject: [PATCH] Removed headings with empty names --- src/main/java/writer2latex/xhtml/GreenstoneTags.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/writer2latex/xhtml/GreenstoneTags.java b/src/main/java/writer2latex/xhtml/GreenstoneTags.java index 0b761af..0abda66 100644 --- a/src/main/java/writer2latex/xhtml/GreenstoneTags.java +++ b/src/main/java/writer2latex/xhtml/GreenstoneTags.java @@ -32,9 +32,13 @@ public class GreenstoneTags { //Get outline level String sLevel = Misc.getAttribute(currentNode, XMLString.TEXT_OUTLINE_LEVEL); + String title = getTitle(currentNode).trim(); if (sLevel == null || sLevel.isEmpty()) { return hnode; } + if (title == null || title.isEmpty()) { + return hnode; + } int nLevel = Integer.parseInt(sLevel); if (pageOpened) { @@ -43,7 +47,7 @@ public class GreenstoneTags { if (headingTags.equals(SECTIONS)){ closeHeadingSections(hnode, nLevel); - String title = getTitle(currentNode); + openHeadingSection(hnode, title); headerStack.offerFirst(Integer.parseInt(sLevel)); }