On Apr 12, 2009, at 2:12 PM, Lee.M wrote:
>> If HTML::Obliterate were to handle all these corner cases using
>> regexp's, then HTML::Strip's claims may actually be correct.
>
> Perhaps, I think the goals are slightly different though so you'd
> never need that much in the way of regexes,
Let me elaborate on what I mean by that:
HTML::Strip isn't just stripping, it's formatting too: (<script>js</
script> is completely removed, <br> is turned into space, &entity; is
turned into the character, etc etc)
So it requires much more logic and resources, which is fine, it is
what it is.
HTML::Obliterate strips HTML w/ no attempt to try an understand what
you mean by it. So it requires much less logic and resources, which is
also fine, it is what it is.
If I were trying to make sure a user didn't submit any HTML I'd rip it
out w/ HTML::Obliterate, if I wanted to turn HTML into some sort of
displayable text I might use HTML::Strip.
I guess my main problem with HTML::Strip is:
- the name is misleading
- it has a memory leak
- it requires too many steps (create an object, parse(), eof() ,
parse, eof, parse, eof, for one thing)
- What does eof() have to do with formatting a line?
(reset_object() would make more sense no?)
That said, if I wanted transformation of HTML into text, it'd do the
job nicely but it isn't done in a 'quick and brutal manner' it's done
in a complex and methodical manner, which, again, is fine because it
is what it is ;p
> plus the memory leak I stumbled across is a pretty bad thing.
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates