(rawAst, frontMatter, parseOptions, parseSubHtml)
| 36 | } |
| 37 | |
| 38 | function postprocess(rawAst, frontMatter, parseOptions, parseSubHtml) { |
| 39 | const isAngular = parseOptions.name === "angular"; |
| 40 | |
| 41 | visitAll(new Visitor(), rawAst.children, { parseOptions }); |
| 42 | |
| 43 | if (frontMatter) { |
| 44 | rawAst.children.unshift(frontMatter); |
| 45 | } |
| 46 | |
| 47 | const ast = new Node(rawAst); |
| 48 | |
| 49 | ast.walk((node) => { |
| 50 | if (node.kind === "comment") { |
| 51 | const ieConditionalComment = parseIeConditionalComment( |
| 52 | node, |
| 53 | parseSubHtml, |
| 54 | ); |
| 55 | if (ieConditionalComment) { |
| 56 | node.parent.replaceChild(node, ieConditionalComment); |
| 57 | } |
| 58 | } else if (isAngular && node.kind === "element" && node.comments) { |
| 59 | node.startTagComments = node.comments; |
| 60 | delete node.comments; |
| 61 | } |
| 62 | |
| 63 | if (isAngular) { |
| 64 | normalizeAngularControlFlowBlock(node); |
| 65 | normalizeAngularLetDeclaration(node); |
| 66 | normalizeAngularIcuExpression(node); |
| 67 | } |
| 68 | }); |
| 69 | |
| 70 | return ast; |
| 71 | } |
| 72 | |
| 73 | // `@else if` |
| 74 | function normalizeAngularControlFlowBlock(node) { |
no test coverage detected
searching dependent graphs…