refactor(ivy): use comment nodes to mark view containers (#24346)

PR Close #24346
This commit is contained in:
Marc Laval
2018-06-06 17:30:48 +02:00
committed by Miško Hevery
parent 153ba4dff3
commit e3c54e4465
11 changed files with 191 additions and 178 deletions

View File

@ -32,11 +32,7 @@ export abstract class BaseFixture {
/**
* Current state of rendered HTML.
*/
get html(): string {
return (this.hostElement as any as Element)
.innerHTML.replace(/ style=""/g, '')
.replace(/ class=""/g, '');
}
get html(): string { return toHtml(this.hostElement as any as Element); }
}
function noop() {}
@ -223,9 +219,10 @@ export function toHtml<T>(componentOrElement: T | RElement): string {
} else {
return stringifyElement(componentOrElement)
.replace(/^<div host="">/, '')
.replace(/^<div fixture="mark">/, '')
.replace(/<\/div>$/, '')
.replace(' style=""', '')
.replace(/<!--[\w]*-->/g, '');
.replace(/<!--container-->/g, '');
}
}