swc/crates/swc_html_parser/tests/fixture/element/basic/output.json

622 lines
16 KiB
JSON
Raw Normal View History

2022-04-07 08:12:54 +03:00
{
"type": "Document",
"span": {
"start": 1,
"end": 388,
2022-04-07 08:12:54 +03:00
"ctxt": 0
},
"mode": "quirks",
2022-04-07 08:12:54 +03:00
"children": [
{
"type": "Element",
2022-04-07 08:12:54 +03:00
"span": {
"start": 0,
"end": 388,
2022-04-07 08:12:54 +03:00
"ctxt": 0
},
"tagName": "html",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Element",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"tagName": "head",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Element",
"span": {
"start": 0,
"end": 388,
"ctxt": 0
},
"tagName": "body",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
2022-04-07 08:12:54 +03:00
{
"type": "Element",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
2022-04-07 08:12:54 +03:00
{
"type": "Text",
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"value": "\n"
},
2022-04-07 08:12:54 +03:00
{
"type": "Element",
"span": {
"start": 13,
"end": 23,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Element",
"span": {
"start": 18,
"end": 23,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
}
],
"content": null
},
2022-04-07 08:12:54 +03:00
{
"type": "Text",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"value": "\n"
},
2022-04-07 08:12:54 +03:00
{
"type": "Element",
"span": {
"start": 36,
"end": 41,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
2022-04-07 08:12:54 +03:00
{
"type": "Element",
"span": {
"start": 47,
"end": 52,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
2022-04-07 08:12:54 +03:00
{
"type": "Text",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "\n"
},
2022-04-07 08:12:54 +03:00
{
"type": "Element",
"span": {
"start": 59,
"end": 63,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "\n"
},
2022-04-08 12:19:58 +03:00
{
"type": "Element",
"span": {
"start": 64,
"end": 70,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 71,
"end": 81,
"ctxt": 0
},
"tagName": "h:ællæ",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 92,
"end": 93,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 93,
"end": 102,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "⚡",
"value": null
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 109,
"end": 121,
"ctxt": 0
},
"tagName": "some-tag-1",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Element",
"span": {
"start": 134,
"end": 146,
"ctxt": 0
},
"tagName": "some-tag-2",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 160,
"end": 188,
"ctxt": 0
},
"tagName": "a",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "href",
"value": "test.html"
}
],
"children": [
{
"type": "Element",
"span": {
"start": 180,
"end": 188,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 185,
"end": 188,
"ctxt": 0
},
"value": "hey"
}
],
"content": null
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 199,
"end": 211,
"ctxt": 0
},
"tagName": "custom-tag",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Element",
"span": {
"start": 224,
"end": 237,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 229,
"end": 237,
"ctxt": 0
},
"value": "Hello :)"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 243,
"end": 244,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 244,
"end": 257,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 249,
"end": 257,
"ctxt": 0
},
"value": "\n\ntest\n\n"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 263,
"end": 265,
"ctxt": 0
},
"value": "\n\n"
},
{
"type": "Element",
"span": {
"start": 265,
"end": 284,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 291,
"end": 311,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 311,
"end": 312,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 312,
"end": 331,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 332,
"end": 350,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 351,
"end": 363,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 357,
"end": 363,
"ctxt": 0
},
"value": "\nTest\n"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 370,
"end": 372,
"ctxt": 0
},
"value": "\n\n"
},
{
"type": "Element",
"span": {
"start": 372,
"end": 381,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 377,
"end": 381,
"ctxt": 0
},
"value": "test"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 387,
"end": 388,
"ctxt": 0
},
"value": "\n"
2022-04-08 12:19:58 +03:00
}
],
"content": null
2022-04-08 12:19:58 +03:00
}
],
"content": null
2022-04-07 08:12:54 +03:00
}
]
}