Re: Retrieving text without dtext option

Gisle Aas <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
kevin <[email protected]> writes:

> I have a program which uses HTML::TokeParser to split apart web
> pages. Is there a way of making $stream->get_text() return the text
> without the entities decoded?

No.  Why do you want that?

It is trivial to reimplement a version of get_text that does what you
want based get_token().  You even have the old get_text that you can
use as a starting point and just insert your version into the
HTML::TokeParser namespace.

   sub HTML::TokeParser::get_undecoded_text {
       ...
   }

> I can see options in get_token but is there an equivalent method
> with get_text or get_trimmed_text?

get_token always returns the raw undecoded text.  There isn't an
option to make it do otherwise.

--Gisle
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.