Merge pull request #3044 from CatoTH/Issue3027-LineNumberingBugfix

Handle STRIKE-tags correctly in line numbering - fixes #3027
This commit is contained in:
Norman Jäckel 2017-03-05 20:22:59 +01:00 committed by GitHub
commit 16743cd9b8
2 changed files with 9 additions and 1 deletions

View File

@ -39,7 +39,8 @@ angular.module('OpenSlidesApp.motions.lineNumbering', [])
this._isInlineElement = function (node) {
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);
};

View File

@ -133,6 +133,13 @@ describe('linenumbering', function () {
expect(outHtml).toBe(noMarkup(1) + '1234 <del>1234</del> ' + brMarkup(2) + '1234 1234');
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);
});
});