Bugfix: Diff and Line breaks at dashes

This commit is contained in:
Tobias Hößl 2018-01-20 11:48:46 +01:00
parent cfefd1c7b7
commit b574502a37
2 changed files with 10 additions and 0 deletions

View File

@ -937,6 +937,7 @@ angular.module('OpenSlidesApp.motions.diff', ['OpenSlidesApp.motions.lineNumberi
arr = splitArrayEntriesSplitSeparator(arr, ".");
arr = splitArrayEntriesSplitSeparator(arr, ",");
arr = splitArrayEntriesSplitSeparator(arr, "!");
arr = splitArrayEntriesSplitSeparator(arr, "-");
arr = splitArrayEntriesEmbedSeparator(arr, "\n", false);
var arrWithoutEmptes = [];

View File

@ -651,6 +651,15 @@ describe('linenumbering', function () {
"<P class=\"insert\"><SPAN>Ya</SPAN></P><INS>\n\n</INS>" +
"<P class=\"insert\">Die Geißlein sagten: \" Liebe Mutter, wir wollen uns schon in acht nehmen, du kannst ohne</P>");
});
it('line breaks at dashes does not delete/insert the last/first word of the split lines', function () {
var before = "<ul><li>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy ei rmodtem-Porinv idunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</li></ul>",
after = "<ul><li>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy ei rmodtem-Porinv idunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</li></ul>";
before = lineNumberingService.insertLineNumbers(before, 90);
var diff = diffService.diff(before, after);
expect(diff).toBe("<ul><li>" + noMarkup(1) + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy ei rmodtem-" + brMarkup(2) + "Porinv idunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</li></ul>");
});
});
describe('addCSSClassToFirstTag function', function () {