HTML::TokeParser leaves numeric entities undecoded in attribute values

Open
#1,457 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
perl
Domain
compilers

Research direction

Start with the HTML::TokeParser behavior described in the issue and the stable failing test t/01_meta-format.t; use the WWW::Mechanize::Plugin::FollowMetaRedirect fixture as integration coverage. Add focused coverage for numeric entity decoding in start-tag attributes, then run the plugin tests on both PerlOnJava backends and confirm the attribute becomes 0; url='result.html'.

Written by the indexing model from the issue text.

Description

area:cpan-port bug

Summary

PerlOnJava's HTML::TokeParser does not decode numeric character references in HTML attribute values. This breaks WWW::Mechanize::Plugin::FollowMetaRedirect when a meta-refresh URL uses ' for an apostrophe.

Reproduction

Distribution: WWW-Mechanize-Plugin-FollowMetaRedirect-0.03

The upstream fixture contains:

<meta http-equiv="refresh" content="0; url=&#39;result.html&#39;" />

The plugin expects HTML::TokeParser to expose the attribute as:

0; url='result.html'

Under PerlOnJava, the attribute remains:

0; url=&#39;result.html&#39;

The plugin consequently requests a malformed file URL containing the literal entity and fails to load result.html.

Results

  • Archived CPAN run: 20260918-141920-96054
  • System Perl: PASS, 4 test files and 86 tests
  • PerlOnJava JVM backend: FAIL
  • PerlOnJava interpreter backend: FAIL
  • Stable failing test: t/01_meta-format.t
  • Other plugin tests pass; 52 subtests run successfully before the malformed URL aborts the test file.

Expected behavior

HTML::TokeParser should decode numeric character references in attribute values consistently with standard Perl. The plugin test should pass on both PerlOnJava backends.

Suggested regression coverage

Add focused HTML::TokeParser coverage for numeric entity decoding in start-tag attributes, especially &#39;, and retain the WWW::Mechanize::Plugin::FollowMetaRedirect fixture as integration coverage.

Dominant language
Perl
Stars
64
Forks
6
Avg merge
5h 25m
Merged PRs (30d)
157

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fglock/PerlOnJava

All issues in fglock/PerlOnJava

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.