[pmwiki-users] Reworked the EnableHtml recipe

Joachim Durchholz jo at durchholz.org
Mon Apr 11 09:30:52 CDT 2005

Hi all,

I just re-hashed the EnableHtml recipe. Here's what I did:

* Wrapped the code into a downloadable function EnableHtml().
* Made the code incremental (multiple calls to EnableHtml will work)
* Made the tag name comparison case-insensitive (<img> and <IMG> will
   now work - yes it's not conformant to XHTML, but it's open to the
   author of the page whether he cares about that - and if he's allowed
   to do HTML directly, we can't give conformance guarantees anyway).
* Made it properly recognise HTML entities like
     <input value="The > character is difficult to handle">
     <input value="foo"/>

I have done some testing on the stability and accuracy of the regex that 
parses tags, but I may have missed some cases. Please mail me any bugs 
that you find. (Note that the regex deliberately allows some invalid 
HTML. Given that catching all invalid HTML is beyond the scope anyway, I 
didn't care too much about catching everything I could, I was more 
concerned about letting everything valid through while keeping the code 


More information about the pmwiki-users mailing list