> -----Original Message----- > From: Craig Cardimon > [mailto:[EMAIL PROTECTED] On > Behalf Of Craig Cardimon > Sent: 06 September 2005 14:40 > To: ActivePerl > Subject: HTML::TokeParser and tags split between lines > > I'm using HTML::TokeParser to remove HTML. This functions > very well when tags are contained on one line. > > What happens when you're reading a file line by line, and the > HTML tag is split between lines? The HTML I'm dealing with is > sometimes broken up. For instance, I'll get lines beginning > with "size=2>" which is the end of a tag that began on the > previous line. > > Any suggestions or recommendation on cleaning up -- as in > removing -- this kind of "broken" HTML?
Unless the html is broken in some way, other than simply being wrapped in the middle of a tag, I would be surprised if that would cause HTML::Parser any problems. However, it sounds, from your description, like you are giving the html to HTML::TokeParser line at a time. I hope I misunderstand, as it seems like an odd thing to do, but it would certainly explain why you are having problems. You need to give HTML::TokeParser the whole document to parse, as described in the documentation for 'new'. HTH -- Brian Raven ----------------------------------------------------------------------- The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary companies. ----------------------------------------------------------------------- _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
