swc/crates/swc_html_parser/tests/fixture/text/lf/output.json
2022-07-17 12:48:21 +00:00

443 lines
12 KiB
JSON

{
"type": "Document",
"span": {
"start": 1,
"end": 305,
"ctxt": 0
},
"mode": "no-quirks",
"children": [
{
"type": "DocumentType",
"span": {
"start": 1,
"end": 16,
"ctxt": 0
},
"name": "html",
"publicId": null,
"systemId": null,
"raw": "<!doctype\nhtml>"
},
{
"type": "Element",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"tagName": "html",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Element",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"tagName": "head",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null,
"isSelfClosing": false
},
{
"type": "Element",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"tagName": "body",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 17,
"end": 22,
"ctxt": 0
},
"data": "Text\n",
"raw": "Text\n"
},
{
"type": "Element",
"span": {
"start": 22,
"end": 37,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 27,
"end": 31,
"ctxt": 0
},
"data": "Text",
"raw": "Text"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 38,
"end": 59,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 43,
"end": 53,
"ctxt": 0
},
"data": "\n Text\n",
"raw": "\n Text\n"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 60,
"end": 92,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 65,
"end": 86,
"ctxt": 0
},
"data": "\n Text\n\n\n Text\n",
"raw": "\n Text\n\n\n Text\n"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 92,
"end": 93,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 93,
"end": 119,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 98,
"end": 113,
"ctxt": 0
},
"data": "Text\n\n\n Text",
"raw": "Text\n\n\n Text"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 120,
"end": 147,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 125,
"end": 136,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "test",
"rawName": "test",
"value": "test",
"rawValue": "\"test\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 138,
"end": 140,
"ctxt": 0
},
"data": "\n\n",
"raw": "\n\n"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 148,
"end": 179,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 153,
"end": 168,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-q",
"rawName": "data-q",
"value": "test",
"rawValue": "\"test\""
}
],
"children": [
{
"type": "Text",
"span": {
"start": 170,
"end": 172,
"ctxt": 0
},
"data": "\n\n",
"raw": "\n\n"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 180,
"end": 211,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 185,
"end": 200,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-q",
"rawName": "data-q",
"value": "test",
"rawValue": "'test'"
}
],
"children": [
{
"type": "Text",
"span": {
"start": 202,
"end": 204,
"ctxt": 0
},
"data": "\n\n",
"raw": "\n\n"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 211,
"end": 212,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 212,
"end": 241,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 217,
"end": 230,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-q",
"rawName": "data-q",
"value": "test",
"rawValue": "test"
}
],
"children": [
{
"type": "Text",
"span": {
"start": 232,
"end": 234,
"ctxt": 0
},
"data": "\n\n",
"raw": "\n\n"
}
],
"content": null,
"isSelfClosing": false
},
{
"type": "Text",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"data": "\n",
"raw": "\n"
},
{
"type": "Element",
"span": {
"start": 242,
"end": 305,
"ctxt": 0
},
"tagName": "style",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 249,
"end": 297,
"ctxt": 0
},
"data": "\n\n.color {\n color: red;\n <!-- Test -->\n}\n\n",
"raw": "\n\n.color {\n color: red;\n <!-- Test -->\n}\n\n"
}
],
"content": null,
"isSelfClosing": false
}
],
"content": null,
"isSelfClosing": false
}
],
"content": null,
"isSelfClosing": false
}
]
}