Merge pull request #3537 from CatoTH/Bugfix-Diff-Linebreaks-At-Dashes

Bugfix: Diff and Line breaks at dashes
This commit is contained in:
Norman Jäckel 2018-01-20 12:41:58 +01:00 committed by GitHub
commit 940f0bbd1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 = splitArrayEntriesSplitSeparator(arr, "!"); arr = splitArrayEntriesSplitSeparator(arr, "!");
arr = splitArrayEntriesSplitSeparator(arr, "-");
arr = splitArrayEntriesEmbedSeparator(arr, "\n", false); arr = splitArrayEntriesEmbedSeparator(arr, "\n", false);
var arrWithoutEmptes = []; 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\"><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>"); "<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 () { describe('addCSSClassToFirstTag function', function () {