Merge pull request #4513 from CatoTH/OS3-Bugfix-Amendment-Diff-Extraction
Bugfix in motion's diff-view: correct amendment diff
This commit is contained in:
commit
1c02d5f496
@ -679,26 +679,18 @@ export class MotionRepositoryService extends BaseAgendaContentObjectRepository<V
|
|||||||
}
|
}
|
||||||
|
|
||||||
const origText = baseParagraphs[paraNo],
|
const origText = baseParagraphs[paraNo],
|
||||||
paragraphLines = this.lineNumbering.getLineNumberRange(origText),
|
|
||||||
diff = this.diff.diff(origText, newText),
|
diff = this.diff.diff(origText, newText),
|
||||||
affectedLines = this.diff.detectAffectedLineRange(diff);
|
affectedLines = this.diff.detectAffectedLineRange(diff);
|
||||||
|
|
||||||
if (affectedLines === null) {
|
if (affectedLines === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
const affectedDiff = this.diff.formatDiff(
|
||||||
let newTextLines = this.lineNumbering.insertLineNumbers(
|
this.diff.extractRangeByLineNumbers(diff, affectedLines.from, affectedLines.to)
|
||||||
newText,
|
|
||||||
lineLength,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
paragraphLines.from
|
|
||||||
);
|
|
||||||
newTextLines = this.diff.formatDiff(
|
|
||||||
this.diff.extractRangeByLineNumbers(newTextLines, affectedLines.from, affectedLines.to)
|
|
||||||
);
|
);
|
||||||
|
const affectedConsolidated = this.diff.diffHtmlToFinalText(affectedDiff);
|
||||||
|
|
||||||
return new ViewMotionAmendedParagraph(amendment, paraNo, newTextLines, affectedLines);
|
return new ViewMotionAmendedParagraph(amendment, paraNo, affectedConsolidated, affectedLines);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.filter((para: ViewMotionAmendedParagraph) => para !== null);
|
.filter((para: ViewMotionAmendedParagraph) => para !== null);
|
||||||
|
Loading…
Reference in New Issue
Block a user