Diff: use comma as a word separator

This commit is contained in:
Tobias Hößl 2017-10-11 20:09:57 +02:00 committed by Emanuel Schütze
parent 20cf124e9e
commit a09a12c55c
3 changed files with 10 additions and 1 deletions

View File

@ -37,7 +37,7 @@ Motions:
- Added config value for pagenumber alignment in PDF [#3327].
- Bugfix: Several bugfixes regarding splitting list items in
change recommendations [#3288].
- Bugfix: Several bugfixes regarding diff version [#3407, #3408, #3410].
- Bugfix: Several bugfixes regarding diff version [#3407, #3408, #3410, #3440].
- Added inline Editing for motion reason [#3361].
- Added multiselect filter for motion comments [#3372].
- Added support for pinning personal notes to the window [#3360].

View File

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

View File

@ -471,6 +471,14 @@ describe('linenumbering', function () {
expect(diff).toBe('Test Test<ins>append</ins>');
});
it('recognizes commas as a word separator', function () {
var before = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat",
after = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat";
var diff = diffService.diff(before, after);
expect(diff).toBe('Lorem ipsum dolor sit amet, consetetur sadipscing elitr<del> sed</del><ins>,</ins> diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat');
});
it('cannot handle changing CSS-classes', function () {
var before = "<p class='p1'>Test1 Test2</p>",
after = "<p class='p2'>Test1 Test2</p>";