1

Topic: Removing 'style' tag

first ..awesome script! thx!

this is my config

$config=array(
'valid_xhtml'=>1,
'tidy'=>1,
'cdata'=>1,    // remove cdata
'comment'=>1 // remove comments
);

i tried with elements=>'*-style'
but the <style type="text/css">....</style> was not parset out

2

Re: Removing 'style' tag

htmLawed is meant only for the <body> element of HTML; <style> belongs to <head> of HTML pages, and elements=>'*-style' has no effect. htmLawed will remove <style> or neutralize it by converting '<' and '>' to entities (like '&lt;', which _will_ appear as '<' in a browser) based on the config. parameter 'keep_bad'.

3

Re: Removing 'style' tag

this is what i get when i paste from openoffice into wysiwyg

<meta http-equiv="CONTENT-TYPE" content="text/html; charset="utf-8"">
    <title></title>
    <meta name="GENERATOR" content="OpenOffice.org 3.0  (Linux)">
    <style type="text/css">
    <!--
        @page { margin: 0.79in }
        P { margin-bottom: 0.08in }
    -->
    </style>

<p style="margin-top: 0.08in;"><font size="2"><strong>test</strong></font></p>

and then after htmLawed

<style type="text/css">
    <!--
        @page { margin: 0.79in }
        P { margin-bottom: 0.08in }
    -->
    </style>

<p style="margin-top: 0.08in;"><font size="2"><strong>test</strong></font></p>

4

Re: Removing 'style' tag

With 'keep_bad' = 6 [removes bad tags altogether; default behavior; needn't be specified] I get the following, expected output on the htmLawed demo site.

    <!--
        @page { margin: 0.79in }
        P { margin-bottom: 0.08in }
    -->

<p style="margin-top: 0.08in;"><span style="font-size: small;"><strong>test</strong></span></p>

I suspect something is not properly set in your application's logic.

5

Re: Removing 'style' tag

you are right :) i had an empty config

sorry