fix(compiler): skip   when trimming / removing whitespaces (#19310)

Fixes #19304
This commit is contained in:
Pawel Kozlowski
2017-09-25 13:33:31 -07:00
committed by Victor Berchet
parent 9ad4b3bd31
commit 13613d4acb
2 changed files with 20 additions and 3 deletions

View File

@ -64,6 +64,16 @@ export function main() {
expect(parseAndRemoveWS(' \n foo \t ')).toEqual([[html.Text, ' foo ', 0]]);
});
it('should not replace  ', () => {
expect(parseAndRemoveWS(' ')).toEqual([[html.Text, '\u00a0', 0]]);
});
it('should not replace sequences of  ', () => {
expect(parseAndRemoveWS('  foo  ')).toEqual([
[html.Text, '\u00a0\u00a0foo\u00a0\u00a0', 0]
]);
});
it('should not replace single tab and newline with spaces', () => {
expect(parseAndRemoveWS('\nfoo')).toEqual([[html.Text, '\nfoo', 0]]);
expect(parseAndRemoveWS('\tfoo')).toEqual([[html.Text, '\tfoo', 0]]);