This reverts commit 973f9b8d19
.
PR Close #43033
This commit is contained in:
parent
dd82bbfa27
commit
6f05dd8062
|
@ -87,10 +87,6 @@ class _Humanizer implements html.Visitor {
|
||||||
private _appendContext(ast: html.Node, input: any[]): any[] {
|
private _appendContext(ast: html.Node, input: any[]): any[] {
|
||||||
if (!this.includeSourceSpan) return input;
|
if (!this.includeSourceSpan) return input;
|
||||||
input.push(ast.sourceSpan.toString());
|
input.push(ast.sourceSpan.toString());
|
||||||
if (ast.sourceSpan.fullStart.offset !== ast.sourceSpan.start.offset) {
|
|
||||||
input.push(ast.sourceSpan.fullStart.file.content.substring(
|
|
||||||
ast.sourceSpan.fullStart.offset, ast.sourceSpan.end.offset));
|
|
||||||
}
|
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -798,8 +798,7 @@ import {humanizeDom, humanizeDomSourceSpans, humanizeLineColumn, humanizeNodes}
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not include leading trivia from the following node of an element in the end source',
|
it('should set the end source span excluding trailing whitespace whitespace', () => {
|
||||||
() => {
|
|
||||||
expect(humanizeDomSourceSpans(
|
expect(humanizeDomSourceSpans(
|
||||||
parser.parse('<input type="text" />\n\n\n <span>\n</span>', 'TestComp', {
|
parser.parse('<input type="text" />\n\n\n <span>\n</span>', 'TestComp', {
|
||||||
leadingTriviaChars: [' ', '\n', '\r', '\t'],
|
leadingTriviaChars: [' ', '\n', '\r', '\t'],
|
||||||
|
@ -810,9 +809,9 @@ import {humanizeDom, humanizeDomSourceSpans, humanizeLineColumn, humanizeNodes}
|
||||||
'<input type="text" />'
|
'<input type="text" />'
|
||||||
],
|
],
|
||||||
[html.Attribute, 'type', 'text', ['text'], 'type="text"'],
|
[html.Attribute, 'type', 'text', ['text'], 'type="text"'],
|
||||||
[html.Text, '\n\n\n ', 0, ['\n\n\n '], '', '\n\n\n '],
|
[html.Text, '\n\n\n ', 0, ['\n\n\n '], ''],
|
||||||
[html.Element, 'span', 0, '<span>\n</span>', '<span>', '</span>'],
|
[html.Element, 'span', 0, '<span>\n</span>', '<span>', '</span>'],
|
||||||
[html.Text, '\n', 1, ['\n'], '', '\n'],
|
[html.Text, '\n', 1, ['\n'], ''],
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue