HtmlMin icon indicating copy to clipboard operation
HtmlMin copied to clipboard

Broken script template tags

Open ozupey opened this issue 1 year ago • 2 comments

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.

ozupey avatar Jul 23 '22 08:07 ozupey

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

voku avatar Jul 23 '22 09:07 voku

No joy, this gives the same output:

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

ozupey avatar Jul 23 '22 09:07 ozupey