Re: htmlfill and CDATA
Ian Bicking <[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
Jacob Smullyan wrote: > On 10/17/06, Ian Bicking <[email protected]> wrote: >> Jacob Smullyan wrote: >> > An application of mine using htmlfill recently stopped working because >> > the template passing through it has evolved to contain CDATA blocks >> > (wrapping the contents of script tags). HTMLParser is the culprit >> > here, and I'm not optimistic about its behavior changing. >> >> What exactly is it doing wrong? > > HTMLParser seems to choke on any CDATA section, whether in a script > tag or elsewhere: > > s="<html><head><title>CDATA test</title></head><body><p><![CDATA[ > this is some cdata. ]]></p></body></html>" > p=HP.HTMLParser() > res=p.feed(s) # blows up with HTMLParseError > > This is Python 2.4.3, but I don't think anything has changed about this > in 2.5. It looks to me if htmlfill.FillingParser can implement unknown_decl, it can handle CDATA on its own (just passing the content through). -- Ian Bicking | [email protected] | http://blog.ianbicking.org ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642