voku / HtmlMin

:clamp: HtmlMin: HTML Compressor and Minifier via PHP
MIT License
161 stars 22 forks source link

Broken script template tags #82

Open ozupey opened 2 years ago

ozupey commented 2 years ago

What is this feature about (expected vs actual behaviour)?

The script below produces this:

____simple_html_dom__voku__html_special_script____ id="foo" type="text/html"> <tr><td colspan=5>  <script id="bar" type="text/html"> foo

How can I reproduce it?

$html = '<script id="foo" type="text/html">
    <tr>
        <td colspan="5">

        </td>
    </tr>
</script>

<script id="bar" type="text/html">
    foo
</script>';

$htmlMin = new \voku\helper\HtmlMin();
echo $htmlMin->minify($html); 

Does it take minutes, hours or days to fix?

Hopefully minutes.

voku commented 2 years ago

Can you try this, but for your type: https://github.com/voku/HtmlMin/issues/77#issuecomment-1160412418

ozupey commented 2 years ago

No joy, this gives the same output:

$htmlMin = new \voku\helper\HtmlMin();
$htmlMin->overwriteSpecialScriptTags(['text/html']);
echo $htmlMin->minify($html);