Rct567/DomQuery

Return wrong html

kartofelek007 opened this issue · 1 comments

I have html with script inline:

<script>
{
    const btn = document.querySelector("#test3");
    btn.addEventListener("click", e => {
        document.querySelector("#test3div").innerHTML = `
            <div class="module">
                <h2>lorem ipsum</h2>
                <p>lorem <strong>lorem </strong></p>
                <button class="button">klik</button>
            </div>
        `;
    });
}
</script>

I use your class:

function generateContentTable($content) {
 $dom = new DomQuery($content);
return $dom->find('html')->html();
}

where $content is all html. This generate wrong html:

<script>
{
    const btn = document.querySelector("#test3");
    btn.addEventListener("click", e => {
        document.querySelector("#test3div").innerHTML = `
            <div class="module">
                <h2>lorem ipsum
                <p>lorem <strong>lorem </strong>
                <button class="button">klik
            </script>
</div>
        `;
    });
}