Skip to content

Fix HTML literal recovery at EOF - #1062

Open
fglock wants to merge 1 commit into
masterfrom
fix/html-parser-literal-eof
Open

Fix HTML literal recovery at EOF#1062
fglock wants to merge 1 commit into
masterfrom
fix/html-parser-literal-eof

Conversation

@fglock

@fglock fglock commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve HTML literal-element state across parse() chunks without emitting duplicate start events
  • mirror HTML::Parser 3.85 EOF recovery for unterminated title content so following markup remains tokenizable
  • add a standard-Perl-validated regression covering the exact token stream and networkless form count

Verification

  • system Perl oracle: html_parser_literal_eof.t passes 2/2
  • exact-master baseline: new fixture fails 2/2 on JVM and interpreter
  • candidate: new fixture passes 2/2 on JVM and interpreter
  • chunk-boundary reducer passes on system Perl, JVM, and interpreter
  • networkless WWW::Mechanize reducer reports both substitutions successful and form counts 1,1 on both backends
  • unmodified WWW::Mechanize 2.22 t/local/overload.t passes 9/9 on JVM and interpreter, including its loopback HTTP path
  • full make: BUILD SUCCESSFUL in 5m 5s, 17/17 tasks executed, warning-free

Scope

This fixes PerlOnJava's HTMLParser.java; no WWW::Mechanize, HTML::Form, HTML::TokeParser, regex/Joni, or upstream test source is changed.

Preserve literal-element state across parse chunks without re-emitting start
events. Mirror HTML::Parser's pending title end behavior at EOF so following
markup remains visible to HTML::Form and other parser consumers.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant