From: Christian Neukirchen Date: 2006-07-24T01:25:33+09:00 Subject: Re: strip tags? "Andreas S." writes: > Daniel Baird wrote: >> On 7/23/06, Stefan Scholl wrote: >>> >>> Max Benjamin wrote: >>> > Is there an easy way to strip html tags from strings? >>> >>> A regex isn't always the _best_ way to deal with markup >>> languages, but for an _easy_ way it's good enough. >> >> >> the problem is, it's not always the _correct_ way. >> >>
> > This is no correct HTML, < and > have to be encoded as entities. It's valid XHTML: $ echo '' | xmllint - However, '<' needs to be escaped: $ echo '' | xmllint - -:1: parser error : Unescaped '<' not allowed in attributes values -- Christian Neukirchen http://chneukirchen.org