Skip to content

Commit

Permalink
Merge pull request #164 from DDS-GmbH/fix/end_loop_stripping
Browse files Browse the repository at this point in the history
Strip paragraphs for loop checking
  • Loading branch information
AntonOellerer authored Sep 26, 2022
2 parents ce5bfe2 + 6d6f545 commit 7e3101d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'com.docutools'
version = '1.5.0'
version = '1.5.1'

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private List<IBodyElement> getLoopBody(String placeholderName, List<IBodyElement
return remaining.stream()
//Could be written nice with `takeUntil(element -> (element instanceof XP xp && eLM.equals(WU.toString(xp)))
.takeWhile(element -> !(element instanceof XWPFParagraph xwpfParagraph
&& endLoopMarkers.stream().anyMatch(endLoopMarker -> endLoopMarker.equals(WordUtilities.toString(xwpfParagraph)))))
&& endLoopMarkers.stream().anyMatch(endLoopMarker -> endLoopMarker.equals(WordUtilities.toString(xwpfParagraph).strip()))))
.toList();
}

Expand Down

0 comments on commit 7e3101d

Please sign in to comment.