swc/crates/swc_html_parser/tests/fixture/comment/basic/output.json
2022-06-14 13:31:23 +00:00

342 lines
8.2 KiB
JSON

{
"type": "Document",
"span": {
"start": 1,
"end": 294,
"ctxt": 0
},
"mode": "no-quirks",
"children": [
{
"type": "DocumentType",
"span": {
"start": 1,
"end": 16,
"ctxt": 0
},
"name": "html",
"publicId": null,
"systemId": null
},
{
"type": "Element",
"span": {
"start": 17,
"end": 294,
"ctxt": 0
},
"tagName": "html",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 23,
"end": 32,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "lang",
"value": "en"
}
],
"children": [
{
"type": "Element",
"span": {
"start": 34,
"end": 76,
"ctxt": 0
},
"tagName": "head",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"data": "\n "
},
{
"type": "Element",
"span": {
"start": 45,
"end": 68,
"ctxt": 0
},
"tagName": "title",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 52,
"end": 60,
"ctxt": 0
},
"data": "Document"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"data": "\n"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"data": "\n"
},
{
"type": "Element",
"span": {
"start": 77,
"end": 294,
"ctxt": 0
},
"tagName": "body",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"data": "\n"
},
{
"type": "Comment",
"span": {
"start": 84,
"end": 97,
"ctxt": 0
},
"data": " test "
},
{
"type": "Text",
"span": {
"start": 97,
"end": 99,
"ctxt": 0
},
"data": "\n\n"
},
{
"type": "Comment",
"span": {
"start": 99,
"end": 111,
"ctxt": 0
},
"data": " foo "
},
{
"type": "Element",
"span": {
"start": 111,
"end": 125,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 116,
"end": 119,
"ctxt": 0
},
"data": "baz"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Comment",
"span": {
"start": 125,
"end": 142,
"ctxt": 0
},
"data": " bar\n\nmoo "
},
{
"type": "Text",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"data": "\n"
},
{
"type": "Element",
"span": {
"start": 143,
"end": 177,
"ctxt": 0
},
"tagName": "script",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 151,
"end": 168,
"ctxt": 0
},
"data": "<!-- alert(1) -->"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"data": "\n"
},
{
"type": "Element",
"span": {
"start": 178,
"end": 208,
"ctxt": 0
},
"tagName": "script",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 186,
"end": 199,
"ctxt": 0
},
"data": "alert('<!--')"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"data": "\n"
},
{
"type": "Element",
"span": {
"start": 209,
"end": 247,
"ctxt": 0
},
"tagName": "script",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 217,
"end": 238,
"ctxt": 0
},
"data": "alert('<!-- foo -->')"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"data": "\n"
},
{
"type": "Element",
"span": {
"start": 248,
"end": 277,
"ctxt": 0
},
"tagName": "script",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 256,
"end": 268,
"ctxt": 0
},
"data": "alert('-->')"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 277,
"end": 294,
"ctxt": 0
},
"data": "\n\n\n"
}
],
"content": null,
"isSelfClosing": false
}
],
"content": null,
"isSelfClosing": false
}
]
}