|Subject:||HTML::Element::as_text collapses internal whitespace|
Hi there! Thanks for this awesome module! However, it appears the ->as_text method for HTML::Element doesn't work as expected. From the docs: -----------8<------------ $h->as_text() Returns a string consisting of only the text parts of the element's descendants. Text under 'script' or 'style' elements is never included in what's returned. If C<skip_dels> is true, then text content under "del" nodes is not included in what's returned. $h->as_trimmed_text(...) This is just like as_text(...) except that leading and trailing whitespace is deleted, and any internal whitespace is collapsed. ----------->8------------ although this is true for leading/trailing spaces, all internal whitespace is collapsed (which should only happen in ->as_trimmed_text, right?). small proof of concept: ======================= perl -MHTML::TreeBuilder -E 'say HTML::TreeBuilder->new_from_content(q[<div>foo bar</div>])->as_text' foo bar hope this helps!