Skip to content

Replace invalid XML escape codes#270

Merged
w3stling merged 6 commits intomasterfrom
replace-invalid-xml-escape-strings
Oct 31, 2025
Merged

Replace invalid XML escape codes#270
w3stling merged 6 commits intomasterfrom
replace-invalid-xml-escape-strings

Conversation

@w3stling
Copy link
Owner

@w3stling w3stling commented Oct 30, 2025

This PR enhances InvalidXmlCharacterFilter to correctly handle HTML escape codes that are not valid in XML.
These codes are now replaced with their valid XML numeric equivalents.

Example:

ä --> ä  // ä
ö --> ö  // ö
ü --> ü  // ü
Ä --> Ä  // Ä
Ö --> Ö  // Ö
Ü --> Ü  // Ü
á --> á // á
é --> é // é
í --> í // í
ó --> ó // ó
ú --> ú // ú
// Special quotes and typographic entities
“ --> "
” --> "
’ --> "

Example of how to use the InvalidXmlCharacterFilter:

RssReader reader = new RssReader();
List<Item> items = reader.addFeedFilter(new InvalidXmlCharacterFilter())
                         .read(URL)
                         .toList();

@w3stling w3stling added the enhancement New feature or request label Oct 30, 2025
@w3stling w3stling changed the title Replace invalid xml escape code Replace invalid escape codes Oct 30, 2025
@github-actions
Copy link

github-actions bot commented Oct 30, 2025

Test Results

 12 files   12 suites   24s ⏱️
307 tests 305 ✅ 2 💤 0 ❌
315 runs  313 ✅ 2 💤 0 ❌

Results for commit 134c823.

♻️ This comment has been updated with latest results.

@sonarqubecloud
Copy link

@w3stling w3stling merged commit 255b146 into master Oct 31, 2025
7 checks passed
@w3stling w3stling deleted the replace-invalid-xml-escape-strings branch October 31, 2025 06:29
@w3stling w3stling changed the title Replace invalid escape codes Replace XML invalid escape codes Oct 31, 2025
@w3stling w3stling changed the title Replace XML invalid escape codes Replace invalid XML escape codes Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant