let a = {
    "startIndex": 0,
    "endIndex": 1479,
    "tagName": "body",
    "attributes": {
        "a": "b"
    },
    "childNodes": [
        {
            "index": 23,
            "tagName": "#text",
            "text": "\n    A\n    "
        },
        {
            "startIndex": 23,
            "endIndex": 58,
            "tagName": "b",
            "attributes": {
                ":href": "#"
            },
            "childNodes": [
                {
                    "index": 54,
                    "tagName": "#text",
                    "text": "\n        LINK\n    "
                }
            ]
        },
        {
            "index": 72,
            "tagName": "#text",
            "text": "\n    B  \n    \n"
        },
        {
            "startIndex": 72,
            "endIndex": 1471,
            "tagName": "script",
            "attributes": {},
            "childNodes": [
                {
                    "tagName": "#text",
                    "text": "\nfunction captureScriptBlock(str, index, finish) {\n    console.log('finish is ', finish)\n    const length = str.length;\n    let start = index;\n    let lit = null;\n    while (index < length) {\n        let cur = str[index];\n        // INSIDE LITERAL\n        if (lit !== null) {\n            // escape\n            if (cur === '\\\\' && str[index + 1] === lit || str[index + 1] === '\\\\' || str[index + 1] === '$') {\n                index += 2;\n                continue;\n            }\n\n            // lit end\n            if (cur === lit) {\n                index ++;\n                lit = null;\n                continue;\n            }\n\n            // in template string block\n            if (lit === '`' && matchAhead(str, index, '${')) {\n                index = captureScriptBlock(str, index+2, '}');\n                console.log('CHARACTER',str[index])\n                index++;\n                continue;\n            }\n            if (!spaceExp.test(cur)) console.log('other lit', lit, cur)\n            // other\n            index++;\n            continue;\n        }\n\n        // OUTSIDE LITERAL\n        // finished\n        if (matchAhead(str, index, finish)) {\n            console.log('matchAhead', finish)\n            return index+finish.length;\n        }\n\n        lit = litStart(cur);\n        if (!spaceExp.test(cur)) console.log(`'other', ${cur}`)\n        index++;\n    }\n    return index\n}\n"
                }
            ]
        },
        {
            "index": 1472,
            "tagName": "#text",
            "text": "\n"
        }
    ]
}
