fix(HtmlParser): ignore LF immediately following pre, textarea & listing

fixes #5630

Closes #5688
This commit is contained in:
Victor Berchet
2015-12-05 00:15:18 -08:00
parent 47f1d12731
commit eb0ea931d0
3 changed files with 37 additions and 4 deletions

View File

@ -178,6 +178,22 @@ export function main() {
expect(humanizeDom(parser.parse('<math />', 'TestComp')))
.toEqual([[HtmlElementAst, '@math:math', 0]]);
});
it('should ignore LF immediately after textarea, pre and listing', () => {
expect(humanizeDom(parser.parse(
'<p>\n</p><textarea>\n</textarea><pre>\n\n</pre><listing>\n\n</listing>',
'TestComp')))
.toEqual([
[HtmlElementAst, 'p', 0],
[HtmlTextAst, '\n', 1],
[HtmlElementAst, 'textarea', 0],
[HtmlElementAst, 'pre', 0],
[HtmlTextAst, '\n', 1],
[HtmlElementAst, 'listing', 0],
[HtmlTextAst, '\n', 1],
]);
});
});
describe('attributes', () => {