From c9870525e17802bc748b417ab23308ef45d2d3a3 Mon Sep 17 00:00:00 2001 From: Gisle Aas Date: Wed, 23 Jul 2008 20:07:32 +0200 Subject: [PATCH] Checkbox picks up nearby text in description of alternates [RT#36771] Telling HTML::Parser to not report all tags make the get_phrase() method look too far ahead. --- lib/HTML/Form.pm | 4 ---- t/html/form.t | 32 +++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/lib/HTML/Form.pm b/lib/HTML/Form.pm index e539cfa..337bbe1 100644 --- a/lib/HTML/Form.pm +++ b/lib/HTML/Form.pm @@ -114,10 +114,6 @@ sub parse require HTML::TokeParser; my $p = HTML::TokeParser->new(ref($html) ? $html->decoded_content(ref => 1) : \$html); die "Failed to create HTML::TokeParser object" unless $p; - eval { - # optimization - $p->report_tags(qw(form input textarea select optgroup option keygen label button)); - }; my $base_uri = delete $opt{base}; my $verbose = delete $opt{verbose}; diff --git a/t/html/form.t b/t/html/form.t index f27da8c..75a455e 100644 --- a/t/html/form.t +++ b/t/html/form.t @@ -3,7 +3,7 @@ use strict; use Test qw(plan ok); -plan tests => 124; +plan tests => 125; use HTML::Form; @@ -535,3 +535,33 @@ ok(join(":", $f->find_input("r1")->value_names), "one"); ok(join(":", $f->find_input("r2")->value_names), "two"); ok(join(":", $f->find_input("r3")->value_names), "nested"); ok(join(":", $f->find_input("r4")->value_names), "before and after"); + +$f = HTML::Form->parse(< + + + + + + + + + + + + +
+     Keep me informed on the progress of this election + +
+
The place you are registered to vote: +
+ County or Parish + + + + Note 2 +
+ +EOT +ok(join(":", $f->find_input("keep_informed")->value_names), "off:"); -- 2.11.4.GIT