fix: nbsp-Dekodierung + Malformed-Input-Test im Truth-Parser (Review Task 5)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 08:09:35 +00:00
parent 71d07659e3
commit f0d4b6d566
2 changed files with 9 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ export function parseTruthFeed(xml: string): TruthPost[] {
const text = descRaw
.replace(/^<!\[CDATA\[|\]\]>$/g, '')
.replace(/<[^>]+>/g, ' ')
.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, "'")
.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/g, ' ')
.replace(/\s+/g, ' ')
.trim();
posts.push({ url, ts, text });