(html: string, keepNgh: boolean)
| 41 | * so that it's easier to make assertions in tests. |
| 42 | */ |
| 43 | export function stripUtilAttributes(html: string, keepNgh: boolean): string { |
| 44 | html = html |
| 45 | .replace(/ ng-version=".*?"/g, '') |
| 46 | .replace(/ ng-server-context=".*?"/g, '') |
| 47 | .replace(/ ng-reflect-(.*?)=".*?"/g, '') |
| 48 | .replace(/ _nghost(.*?)=""/g, '') |
| 49 | .replace(/ _ngcontent(.*?)=""/g, ''); |
| 50 | if (!keepNgh) { |
| 51 | html = html |
| 52 | .replace(NGH_ATTR_REGEXP, '') |
| 53 | .replace(EMPTY_TEXT_NODE_REGEXP, '') |
| 54 | .replace(TEXT_NODE_SEPARATOR_REGEXP, ''); |
| 55 | } |
| 56 | return html; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Extracts a portion of HTML located inside of the `<body>` element. |
no test coverage detected
searching dependent graphs…