Skip to content

Commit

Permalink
Merge pull request #113 from PAException/issue/112
Browse files Browse the repository at this point in the history
Fixed appendTextOnLastSubstitute when substitutes are split
  • Loading branch information
PAException authored Nov 22, 2023
2 parents 6e25888 + d9c985a commit 5b2558f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,15 @@ private List<SubstituteDTO> createSubstituteDTOs(Element row, Date currentDate)
private void appendTextOnLastSubstitute(Element row, List<SubstituteDTO> substitutes) {
int indexOfLastSubstitute = substitutes.size() - 1;
String textToAppend = row.children().get(row.children().size() - 1).text();
SubstituteDTO dto = substitutes.get(indexOfLastSubstitute);

substitutes.set(indexOfLastSubstitute, dto.appendText(textToAppend));
for (; indexOfLastSubstitute >= 0; indexOfLastSubstitute--) {
SubstituteDTO dto = substitutes.get(indexOfLastSubstitute);
substitutes.set(indexOfLastSubstitute, dto.appendText(textToAppend));

if (indexOfLastSubstitute > 0) {
if (!dto.sameBase(substitutes.get(indexOfLastSubstitute - 1))) break;
}
}
}

/**
Expand Down

0 comments on commit 5b2558f

Please sign in to comment.