Removed headings with empty names

This commit is contained in:
Georgy Litvinov 2018-07-31 13:23:38 +03:00 committed by Georgy Litvinov
parent ca99fe94f0
commit fcce0d14d6

View file

@ -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));
}