Skip to content

Commit 8833853

Browse files
committed
Fix another verse end detection edge case
When the verse to end is an empty verse at the end of the chapter or book, we do not find the (empty) ParatextCharacterContent we use for deciding where to add our verse end. Therefore, add one. Fixes #98.
1 parent dda3d14 commit 8833853

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

biblemulticonverter/src/main/java/biblemulticonverter/format/paratext/utilities/ImportUtilities.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public static void closeOpenVerse(ParatextBook result, ParatextBook.VerseStart o
3636
// belongs to a header.
3737
// - Not before the corresponding openVerse
3838
List<ParatextBook.ParatextBookContentPart> bookParts = result.getContent();
39+
if (!bookParts.isEmpty() && bookParts.get(bookParts.size() - 1) == openVerse) {
40+
// the open verse is an empty verse at the end of a
41+
// chapter/book. Provide a place to put the verse end.
42+
bookParts.add(new ParatextCharacterContent());
43+
}
3944
ListIterator<ParatextBook.ParatextBookContentPart> bookPartsIterator = bookParts.listIterator(bookParts.size());
4045
boolean didAddVerseEndMilestone = false, verseStartFound = false, paraSwitchFound = false;
4146
ParatextCharacterContent lastSuitableContentContainer = null;

0 commit comments

Comments
 (0)