Skip Menu |
 

This queue is for tickets about the HTML-Tree CPAN distribution.

Report information
The Basics
Id: 70385
Status: resolved
Priority: 0/
Queue: HTML-Tree

People
Owner: Nobody in particular
Requestors: bokutin [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 4.2
Fixed in: 5.03



Subject: textarea broken by $root->as_HTML( .., ' ' ) indentation.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1313876627-2952-57"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 182
Download (untitled) / with headers
text/plain 182b
Hi. I used CSS::Inliner. CSS::Inliner depend HTML::Tree. I occurred <textarea> broken. I found a bug and fixed and wrote test bit. Please merge this patch. Cheers Tomohiro Hosaka
Subject: bug_textarea.txt
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; name="bug_textarea.txt"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="bug_textarea.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
Content-Length: 1799
Download bug_textarea.txt
text/plain 1.7k
diff -ru HTML-Tree-4.2.orig/lib/HTML/Element.pm HTML-Tree-4.2/lib/HTML/Element.pm --- HTML-Tree-4.2.orig/lib/HTML/Element.pm 2011-04-06 17:37:54.000000000 +0900 +++ HTML-Tree-4.2/lib/HTML/Element.pm 2011-08-21 06:31:36.000000000 +0900 @@ -1583,7 +1583,7 @@ $last_tag_tightenable = $this_tag_tightenable; ++$nonindentable_ancestors - if $tag eq 'pre' + if $tag eq 'pre' or $tag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$tag}; } @@ -1594,7 +1594,7 @@ { # on the way out - if ( $tag eq 'pre' + if ( $tag eq 'pre' or $tag eq 'textarea' or $HTML::Tagset::isCDATA_Parent{$tag} ) { --$nonindentable_ancestors; diff -ru HTML-Tree-4.2.orig/t/body.t HTML-Tree-4.2/t/body.t --- HTML-Tree-4.2.orig/t/body.t 2011-04-06 17:37:54.000000000 +0900 +++ HTML-Tree-4.2/t/body.t 2011-08-21 06:30:34.000000000 +0900 @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 11; +use Test::More tests => 13; BEGIN { use_ok('HTML::TreeBuilder'); @@ -89,3 +89,12 @@ "<html><head></head><body><b>\$self->escape</b></body></html>" ) ; # 3.22 compatability } + +NO_INDENT_PRE_AND_TEXTAREA: { + my $root = HTML::TreeBuilder->new(); + my $pre = '<pre></pre>'; + my $textarea = '<textarea></textarea>'; + my $html = $root->parse_content("<html><head></head><body>$pre$textarea</body></html>"); + like( $html->as_HTML(), qr/$pre.*$textarea/ ); + like( $html->as_HTML( undef, " " ), qr/$pre.*$textarea/ ); +}
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-8954-1348363728-590.70385-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 342
Download (untitled) / with headers
text/plain 342b
I've merged this as https://github.com/madsen/HTML-Tree/commit/466ece91fd6b829515f568871b1ecf8fe41fc329 (except for the tests, which I rewrote) and just released 5.03 to CPAN. Sorry it took so long, but I overlooked this when I was looking for fixes to apply. It helps if you include PATCH in the subject (or send a pull request on GitHub).
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-29097-1348373448-1930.70385-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 21
Thank you very much!!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.