Skip to content

Commit

Permalink
fix split crash with totally empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhendricks committed Oct 20, 2021
1 parent 6fba877 commit 70f4618
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Sigil-1.8.0
- Fix double copy to Clipboard from OPF and NCX Tabs
- Fix GoToLinkOrStyle when class attribute present but cursor not in the class attribute
- Fix TabManager scroll to position to properly handle position of 0
- Fix crash using Split At Markers when body tag is completely empty (no whitespace or anything)

New Features:
- BookBrowser can now link javascripts similarly to how it links stylesheets
Expand Down
8 changes: 7 additions & 1 deletion src/BookManipulation/XhtmlDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,13 @@ QStringList XhtmlDoc::GetSGFSectionSplits(const QString &source,
sections.append(header + open_tag_source + text + "</body>\n</html>\n");
// let gumbo/mend fill in any necessary closing tags for any open tags
// at the end of each section
}
}
// if body is empty (no split marker) then sections will be empty which should not happen
// handle this special case
if (sections.isEmpty()) {
sections << source;
}

return sections;
}

Expand Down

0 comments on commit 70f4618

Please sign in to comment.