From 2ca1b3afa5da07975a5e8b591569fd369353f146 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 21 Sep 2025 22:12:30 +0800 Subject: [PATCH] feat(route): add Wikipedia current events (#20100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(route): add Wikipedia current events Add RSS feed for Wikipedia Portal:Current events providing the past 7 days of current events. Parses MediaWiki templates and converts wiki markup to HTML. - Hierarchical bullet point structures with nested '); + currentDepth--; + } + + return result.join(''); +} + +function stripComments(html: string): string { + // Remove HTML comments + return html.replaceAll(//g, ''); +} + +function wrapInParagraphsAndCleanup(html: string): string { + // Clean up multiple paragraph tags and empty paragraphs + html = html.replaceAll(/<\/p>\s*

/g, '

\n

'); + html = html.replaceAll(/

\s*