diff --git a/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java b/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java index c4341be..bfaa4f2 100644 --- a/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java +++ b/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java @@ -71,6 +71,9 @@ final boolean showTitles = ref.hasRanges(RestrictionType.CHAPTER) || !allowEmpty; RawTextToXmlProcessor processor = new RawTextToXmlProcessor() { + // track previous text to exclude duplicates caused by merged verses + private String previousVerseText = ""; + public void preRange(VerseRange range, List partialDom) { if (showTitles) { Element title = OSISUtil.factory().createGeneratedTitle(); @@ -81,10 +84,11 @@ public void postVerse(Key verse, List partialDom, String rawText) { // If the verse is empty then we shouldn't add the verse tag - if (allowEmpty || rawText.length() > 0) { + if ((allowEmpty || rawText.length() > 0 ) && !previousVerseText.equals(rawText)) { List osisContent = filter.toOSIS(AbstractPassageBook.this, verse, rawText); addOSIS(verse, partialDom, osisContent); } + previousVerseText = rawText; } public void init(List partialDom) {