|
| 1 | +--- |
| 2 | +source: crates/biome_html_parser/tests/spec_test.rs |
| 3 | +assertion_line: 145 |
| 4 | +expression: snapshot |
| 5 | +--- |
| 6 | + |
| 7 | +## Input |
| 8 | + |
| 9 | +```astro |
| 10 | +--- |
| 11 | +const RE = /\d{4}/ |
| 12 | +--- |
| 13 | +
|
| 14 | +<div /> |
| 15 | +
|
| 16 | +``` |
| 17 | + |
| 18 | + |
| 19 | +## AST |
| 20 | + |
| 21 | +``` |
| 22 | +HtmlRoot { |
| 23 | + bom_token: missing (optional), |
| 24 | + frontmatter: AstroFrontmatterElement { |
| 25 | + l_fence_token: FENCE@0..3 "---" [] [], |
| 26 | + content: AstroEmbeddedContent { |
| 27 | + content_token: HTML_LITERAL@3..23 "const RE = /\\d{4}/\n" [Newline("\n")] [], |
| 28 | + }, |
| 29 | + r_fence_token: FENCE@23..26 "---" [] [], |
| 30 | + }, |
| 31 | + directive: missing (optional), |
| 32 | + html: HtmlElementList [ |
| 33 | + HtmlSelfClosingElement { |
| 34 | + l_angle_token: L_ANGLE@26..29 "<" [Newline("\n"), Newline("\n")] [], |
| 35 | + name: HtmlTagName { |
| 36 | + value_token: HTML_LITERAL@29..33 "div" [] [Whitespace(" ")], |
| 37 | + }, |
| 38 | + attributes: HtmlAttributeList [], |
| 39 | + slash_token: SLASH@33..34 "/" [] [], |
| 40 | + r_angle_token: R_ANGLE@34..35 ">" [] [], |
| 41 | + }, |
| 42 | + ], |
| 43 | + eof_token: EOF@35..36 "" [Newline("\n")] [], |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +## CST |
| 48 | + |
| 49 | +``` |
| 50 | +0: HTML_ROOT@0..36 |
| 51 | + 0: (empty) |
| 52 | + 1: ASTRO_FRONTMATTER_ELEMENT@0..26 |
| 53 | + 0: FENCE@0..3 "---" [] [] |
| 54 | + 1: ASTRO_EMBEDDED_CONTENT@3..23 |
| 55 | + 0: HTML_LITERAL@3..23 "const RE = /\\d{4}/\n" [Newline("\n")] [] |
| 56 | + 2: FENCE@23..26 "---" [] [] |
| 57 | + 2: (empty) |
| 58 | + 3: HTML_ELEMENT_LIST@26..35 |
| 59 | + 0: HTML_SELF_CLOSING_ELEMENT@26..35 |
| 60 | + 0: L_ANGLE@26..29 "<" [Newline("\n"), Newline("\n")] [] |
| 61 | + 1: HTML_TAG_NAME@29..33 |
| 62 | + 0: HTML_LITERAL@29..33 "div" [] [Whitespace(" ")] |
| 63 | + 2: HTML_ATTRIBUTE_LIST@33..33 |
| 64 | + 3: SLASH@33..34 "/" [] [] |
| 65 | + 4: R_ANGLE@34..35 ">" [] [] |
| 66 | + 4: EOF@35..36 "" [Newline("\n")] [] |
| 67 | +
|
| 68 | +``` |
0 commit comments