Fix HTML::Lint parser text and source-position mismatches
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- compilers, testing-qa
Research direction
Start with the shared PerlOnJava parser/scalar state handling used by HTML::Lint::Parser, then run the focused tests in t/10-test-html-lint.t, t/20-error-types-skip.t, t/40-where.t, and related files listed in the issue against both backends and system Perl. Done means both backend suites pass, structural diagnostics and source positions match system Perl, and a focused regression test covers the smallest token/position reproducer.
Written by the indexing model from the issue text.
Description
HTML::Lint parser loses undefined text and source positions on both backends
Summary
The CPAN compatibility run for HTML::Lint v2.32 reports widespread failures in the pure-Perl HTML parser. The system-Perl suite passes, while both PerlOnJava execution backends reproduce the same failure pattern.
CPAN run: 20260916-111623-23683
Evidence
- Tester-selected target:
Test::HTML::Lint - System Perl: 352 tests pass across 44 test programs; only the optional POD-coverage test is skipped.
- PerlOnJava JVM backend: 174 of 357 subtests fail across 35 of 44 test programs.
- PerlOnJava interpreter backend: reproduces the same failure pattern in the focused/full-harness run.
- No native dependency, external service, or platform prerequisite is involved.
Representative failures include:
HTML::Lint::Parserreceives or exposes an empty/undefined text value incorrectly, producing repeated warnings such asUse of uninitialized value $text in pattern match.- Empty attribute values are reported as
Unknown attribute ""on otherwise valid tags such ashtml,head,body,title, andp. - Expected structural errors such as
elem-unopened,elem-unclosed, anddoc-tag-requiredare replaced byattr-unknownerrors. - Error locations collapse to
(:1)or(0:1)instead of preserving the expected source line and column, for example(1:1).
The resulting failures affect t/10-test-html-lint.t, t/11-test-html-lint-overload.t, t/12-html_fragment_ok.t, t/20-error-types-skip.t, t/30-test-builder.t, t/40-where.t, t/50-multiple-files.t, and additional parser behavior tests.
Suspected cause
The failure appears to be in shared PerlOnJava parser/scalar state handling used by HTML::Lint::Parser: an absent token/text value is being represented as an empty string, and token position metadata is not preserved. This changes both the parser’s error classification and its reported source coordinates. Because both backends agree, the defect is likely in shared runtime/parser infrastructure rather than a backend-specific compiler path.
Suggested acceptance criteria
HTML::Lintv2.32’st/*.tsuite passes on the JVM backend.- The same suite passes on the interpreter backend.
- Undefined parser text does not become a spurious empty attribute value.
- Structural error codes and messages match system Perl.
- Source line and column information is preserved in parser diagnostics.
- Add a focused project-owned regression test for the smallest token/position reproducer, validated against system Perl.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 18m
- Merged PRs (30d)
- 162
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:cpan-port area:parser area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
fglock/PerlOnJava#1477 ·
-
area:cpan-port area:parser area:unicode bug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
fglock/PerlOnJava#1476 ·
-
area:backend area:cpan-port area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
fglock/PerlOnJava#1475 ·
-
area:parser area:warnings bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
fglock/PerlOnJava#1473 ·
All issues in fglock/PerlOnJava
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
corazawaf/coraza-nginx#140 ·
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100