This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +1
-29
lines changed Expand file tree Collapse file tree 2 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -54,22 +54,12 @@ class TestBed {
54
54
return rootElement;
55
55
}
56
56
57
- String _handleWhitespace (html) {
58
- return html
59
- .split ('\n ' )
60
- .map ((line) {
61
- var trimmed = line.trim ();
62
- return trimmed +
63
- (trimmed.isEmpty || trimmed.endsWith ('>' ) ? '' : ' ' );
64
- })
65
- .join ();
66
- }
67
57
/**
68
58
* Convert an [html] String to a [List] of [Element] s.
69
59
*/
70
60
List <Element > toNodeList (html) {
71
61
var div = new DivElement ();
72
- var sanitizedHtml = _handleWhitespace ( html);
62
+ var sanitizedHtml = html. split ( ' \n ' ). map ((line) => line. trim ()). join ( ' ' );
73
63
div.setInnerHtml (sanitizedHtml, treeSanitizer: new NullTreeSanitizer ());
74
64
var nodes = [];
75
65
for (var node in div.nodes) {
Original file line number Diff line number Diff line change @@ -27,24 +27,6 @@ void main() {
27
27
expect (directiveInst.destroyed).toBe (true );
28
28
});
29
29
30
- it ('should handle whitespace cleanly' , () {
31
- var root = _.compile ('''
32
- <div>
33
- <h1
34
- attr="Hi">
35
- </h1>
36
- </div>
37
- <span
38
- attr2="Bye"
39
-
40
- ></span>
41
- ''' );
42
-
43
- expect (root.runtimeType).toBe (DivElement );
44
- expect (_.rootElements[1 ].runtimeType).toBe (SpanElement );
45
- expect (_.rootElements.length).toBe (2 );
46
- });
47
-
48
30
});
49
31
}
50
32
You can’t perform that action at this time.
0 commit comments