Skip to content

Mixed-case RCDATA end tags can promote text to markup #2503

Description

@jhy

RCDATA elements like <title> and <textarea> should match their end tags case-insensitively. A direct mixed-case closer works as expected: <title>Foo</TiTLE> closes the title. But when tag-shaped text appears before the closer, jsoup can miss the mixed-case end tag and leave RCDATA early.

For example, <title><p>Foo</TiTLE> creates a real body p element instead of keeping <p>Foo as title text. Similarly, <textarea><img src=x></TeXtArEa> creates an img element.

This was a premature optimization: the implementation only looked for consistent-case matches. I’ll fix it with a real case-insensitive scan.

Metadata

Metadata

Assignees

Labels

bugA confirmed bug, that we should fixfixedAn {bug|improvement} that has been {fixed|implemented}

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions