Merge pull request #3548 from CatoTH/Bugfix-Diff-Inserted-Whitespace-After-BR
Diff-Bugfix: Whitespace was inserted after <br>
This commit is contained in:
commit
172581d557
@ -38,7 +38,7 @@ Motions:
|
|||||||
- Bugfix: Several bugfixes regarding splitting list items in
|
- Bugfix: Several bugfixes regarding splitting list items in
|
||||||
change recommendations [#3288].
|
change recommendations [#3288].
|
||||||
- Bugfix: Several bugfixes regarding diff version [#3407, #3408, #3410,
|
- Bugfix: Several bugfixes regarding diff version [#3407, #3408, #3410,
|
||||||
#3440, #3450, #3465, #3537, #3546].
|
#3440, #3450, #3465, #3537, #3546, #3548].
|
||||||
- Added inline Editing for motion reason [#3361].
|
- Added inline Editing for motion reason [#3361].
|
||||||
- Added multiselect filter for motion comments [#3372].
|
- Added multiselect filter for motion comments [#3372].
|
||||||
- Added support for pinning personal notes to the window [#3360].
|
- Added support for pinning personal notes to the window [#3360].
|
||||||
|
@ -675,6 +675,9 @@ angular.module('OpenSlidesApp.motions.diff', ['OpenSlidesApp.motions.lineNumberi
|
|||||||
for (var ent in entities) {
|
for (var ent in entities) {
|
||||||
html = html.replace(new RegExp(ent, 'g'), entities[ent]);
|
html = html.replace(new RegExp(ent, 'g'), entities[ent]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Newline characters: after closing block-level-elements, but not after BR (which is inline)
|
||||||
|
html = html.replace(/(<br *\/?>)\n/gi, "$1");
|
||||||
html = html.replace(/[ \n\t]+/gi, ' ');
|
html = html.replace(/[ \n\t]+/gi, ' ');
|
||||||
html = html.replace(/(<\/(div|p|ul|li|blockquote>)>) /gi, "$1\n");
|
html = html.replace(/(<\/(div|p|ul|li|blockquote>)>) /gi, "$1\n");
|
||||||
|
|
||||||
|
@ -423,6 +423,14 @@ describe('linenumbering', function () {
|
|||||||
expect(diff).toBe('The <strong>brown</strong> spotted fox <del>jum</del><ins>lea</ins>ped over the rolling log.');
|
expect(diff).toBe('The <strong>brown</strong> spotted fox <del>jum</del><ins>lea</ins>ped over the rolling log.');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not insert spaces after a unchanged BR tag', function() {
|
||||||
|
var before = "<p>" + noMarkup(1) + "Hendl Kirwa hod Maßkruag<br>" + noMarkup(2) + "gmahde Wiesn</p>",
|
||||||
|
after = "<p>Hendl Kirwa hod Maßkruag<br>\ngmahde Wiesn</p>";
|
||||||
|
var diff = diffService.diff(before, after);
|
||||||
|
|
||||||
|
expect(diff).toBe(before);
|
||||||
|
});
|
||||||
|
|
||||||
it('does not mark the last line of a paragraph as change if a long new one is appended', function () {
|
it('does not mark the last line of a paragraph as change if a long new one is appended', function () {
|
||||||
var before = "<p><span class=\"os-line-number line-number-5\" data-line-number=\"5\" contenteditable=\"false\"> </span>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>",
|
var before = "<p><span class=\"os-line-number line-number-5\" data-line-number=\"5\" contenteditable=\"false\"> </span>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>",
|
||||||
after = "<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>\n" +
|
after = "<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>\n" +
|
||||||
|
Loading…
Reference in New Issue
Block a user