swc/crates/swc_html_parser/tests/fixture/element/basic/output.json
2022-05-17 08:23:24 +00:00

706 lines
18 KiB
JSON

{
"type": "Document",
"span": {
"start": 1,
"end": 486,
"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": 479,
"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": 69,
"ctxt": 0
},
"tagName": "head",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"value": "\n "
},
{
"type": "Element",
"span": {
"start": 45,
"end": 60,
"ctxt": 0
},
"tagName": "title",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 52,
"end": 60,
"ctxt": 0
},
"value": "Document"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"value": "\n"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 77,
"end": 479,
"ctxt": 0
},
"tagName": "body",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 84,
"end": 89,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 96,
"end": 106,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Element",
"span": {
"start": 101,
"end": 106,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 119,
"end": 124,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Element",
"span": {
"start": 130,
"end": 135,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 142,
"end": 146,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 147,
"end": 153,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 154,
"end": 164,
"ctxt": 0
},
"tagName": "h:ællæ",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 176,
"end": 185,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "⚡",
"value": null
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 192,
"end": 204,
"ctxt": 0
},
"tagName": "some-tag-1",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Element",
"span": {
"start": 217,
"end": 229,
"ctxt": 0
},
"tagName": "some-tag-2",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 243,
"end": 271,
"ctxt": 0
},
"tagName": "a",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 246,
"end": 262,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "href",
"value": "test.html"
}
],
"children": [
{
"type": "Element",
"span": {
"start": 263,
"end": 271,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 268,
"end": 271,
"ctxt": 0
},
"value": "hey"
}
],
"content": null
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 282,
"end": 294,
"ctxt": 0
},
"tagName": "custom-tag",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [],
"content": null
},
{
"type": "Element",
"span": {
"start": 307,
"end": 320,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 312,
"end": 320,
"ctxt": 0
},
"value": "Hello :)"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 326,
"end": 327,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 327,
"end": 340,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 332,
"end": 340,
"ctxt": 0
},
"value": "\n\ntest\n\n"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 346,
"end": 348,
"ctxt": 0
},
"value": "\n\n"
},
{
"type": "Element",
"span": {
"start": 348,
"end": 367,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 353,
"end": 366,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 374,
"end": 394,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 378,
"end": 391,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 395,
"end": 414,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 399,
"end": 412,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 414,
"end": 415,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 415,
"end": 433,
"ctxt": 0
},
"tagName": "br",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [
{
"type": "Attribute",
"span": {
"start": 419,
"end": 432,
"ctxt": 0
},
"namespace": null,
"prefix": null,
"name": "data-test",
"value": "a"
}
],
"children": [],
"content": null
},
{
"type": "Text",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"value": "\n"
},
{
"type": "Element",
"span": {
"start": 434,
"end": 446,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 440,
"end": 446,
"ctxt": 0
},
"value": "\nTest\n"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 453,
"end": 455,
"ctxt": 0
},
"value": "\n\n"
},
{
"type": "Element",
"span": {
"start": 455,
"end": 464,
"ctxt": 0
},
"tagName": "div",
"namespace": "http://www.w3.org/1999/xhtml",
"attributes": [],
"children": [
{
"type": "Text",
"span": {
"start": 460,
"end": 464,
"ctxt": 0
},
"value": "test"
}
],
"content": null
},
{
"type": "Text",
"span": {
"start": 470,
"end": 479,
"ctxt": 0
},
"value": "\n\n"
}
],
"content": null
}
],
"content": null
}
]
}