Topic: Stripping away <script>*</script> and <style>*</style> blocks
I'm trying to strip away script and style code blocks entirely.
HTML in:
<style type="text/css">
.foo { color:blue; }
</style>
<div class="foo">hello world</div>
<script type="text/javascript">
if (true) {
var foo = 'bar';
}
</script>
Tried with this htmlLawed:
$htmlOut = htmLawed(
$htmlIn,
array(
'comment' => 1,
'safe' => 1,
)
);
What I'd like:
<div class="foo">hello world</div>
What I get instead:
.foo { color:blue; }
<div class="foo">hello world</div>
if (true) {
var foo = 'bar';
}
I'm not sure it is even possibile. Tried also all keep_bad possibile values with no luck.