Handle STRIKE-tags correctly in line numbering

This commit is contained in:
Tobias Hößl 2017-03-04 16:17:48 +01:00
parent 95c19159f8
commit c8006588c5
2 changed files with 9 additions and 1 deletions

View File

@ -39,7 +39,8 @@ angular.module('OpenSlidesApp.motions.lineNumbering', [])
this._isInlineElement = function (node) { this._isInlineElement = function (node) {
var inlineElements = [ var inlineElements = [
'SPAN', 'A', 'EM', 'S', 'B', 'I', 'STRONG', 'U', 'BIG', 'SMALL', 'SUB', 'SUP', 'TT', 'INS', 'DEL' 'SPAN', 'A', 'EM', 'S', 'B', 'I', 'STRONG', 'U', 'BIG', 'SMALL', 'SUB', 'SUP', 'TT', 'INS', 'DEL',
'STRIKE'
]; ];
return (inlineElements.indexOf(node.nodeName) > -1); return (inlineElements.indexOf(node.nodeName) > -1);
}; };

View File

@ -133,6 +133,13 @@ describe('linenumbering', function () {
expect(outHtml).toBe(noMarkup(1) + '1234 <del>1234</del> ' + brMarkup(2) + '1234 1234'); expect(outHtml).toBe(noMarkup(1) + '1234 <del>1234</del> ' + brMarkup(2) + '1234 1234');
expect(lineNumberingService.stripLineNumbers(outHtml)).toBe(inHtml); expect(lineNumberingService.stripLineNumbers(outHtml)).toBe(inHtml);
}); });
it('handles STRIKE-tags', function () {
var inHtml = '<p>et accusam et justo duo dolores et ea <span style="color: #ff0000;"><strike>rebum </strike></span><span style="color: #006400;">Inserted Text</span>. Stet clita kasd gubergren,</p>';
var outHtml = lineNumberingService.insertLineNumbers(inHtml, 80);
expect(outHtml).toBe('<p>' + noMarkup(1) + 'et accusam et justo duo dolores et ea <span style="color: #ff0000;"><strike>rebum </strike></span><span style="color: #006400;">Inserted Text</span>. Stet clita kasd ' + brMarkup(2) + 'gubergren,</p>');
expect(lineNumberingService.stripLineNumbers(outHtml)).toBe(inHtml);
});
}); });