( htmlAstWithErrors: ParseTreeResult, preserveSignificantWhitespace: boolean, )
| 276 | } |
| 277 | |
| 278 | export function removeWhitespaces( |
| 279 | htmlAstWithErrors: ParseTreeResult, |
| 280 | preserveSignificantWhitespace: boolean, |
| 281 | ): ParseTreeResult { |
| 282 | return new ParseTreeResult( |
| 283 | visitAllWithSiblings( |
| 284 | new WhitespaceVisitor(preserveSignificantWhitespace), |
| 285 | htmlAstWithErrors.rootNodes, |
| 286 | ), |
| 287 | htmlAstWithErrors.errors, |
| 288 | ); |
| 289 | } |
| 290 | |
| 291 | interface SiblingVisitorContext { |
| 292 | prev: html.Node | undefined; |
no test coverage detected