1

Topic: Completely-cleaned output

Hello,

I am new to htmlawed and have a question that I am sure is simple.

I may be missing something here but when I pass the string to the htmlaw function and echo the cleaned up string it appears that some of the tags that it has cleaned show up on the page.  For example the below will show up.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- div, p {
   font-family: Calibri, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #000000; 
  } //-->

Is there a way to to discard this rather than display it?

Thank You,

Jason

2

Re: Completely-cleaned output

htmLawed converts characters like '<' in filtered tags to entities like '&gt;' to neutralize the HTML markup. If you look at the output in a browser, you'll see the characters referred to by the entities (i.e., '<' and not '&gt;'), but if you look at the source code or the output using something other than the browser you'll find the entities explicitly.

To have htmLawed completely remove the tags and not entitify them, set the 'config' parameter 'keep_bad' to 0. To remove HTML comments (like the one in your example), set 'comments' to 1.

Note that htmLawed is meant only for HTML '<body>' content; it will thus remove/entitify '<head>' or '<!DOCTYPE>'.