Skip to content

Decode HTML named entities in malformed feeds - #351

Merged
prof18 merged 1 commit into
masterfrom
fix/html-named-entities
Nov 8, 2026
Merged

prof18 merged 1 commit into
masterfrom
fix/html-named-entities

Conversation

@prof18

@prof18 prof18 commented Nov 8, 2026

Copy link
Copy Markdown
Owner

The escaping retry for malformed feeds now turns HTML named entities like Ä and   into numeric references, so they come out as the right characters instead of literal text. The retry also runs on web, where DOMParser parse errors used to give an empty feed, and on Android, where the nested-tag recovery added in 6.1.1 swallowed entity errors and dropped text before a bare &. Fixes #204.

Feeds that copy HTML entities like Ä or   fail to parse, and
the escaping retry turned them into literal text. The retry now maps the
HTML 4 named entities to numeric character references before escaping
bare ampersands.

The retry also never ran in two places. On web the DOMParser doesn't
throw on malformed XML, it returns a parsererror document that decodes
to an empty or truncated feed: that is now reported as a failure. On
Android the nested-tag recovery in nextTrimmedText, added in 6.1.1,
swallowed entity errors too, dropping the text before a bare ampersand:
it now only recovers when the parser stopped on a child tag.

Fixes #204
@prof18
prof18 enabled auto-merge (rebase) November 8, 2026 15:34
@prof18
prof18 merged commit b81c008 into master Nov 8, 2026
10 checks passed
@prof18
prof18 deleted the fix/html-named-entities branch November 8, 2026 15:46
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.

Parsing feed fails if it has html encoded characters

1 participant