Compare commits

...

2 Commits

Author SHA1 Message Date
7035f3e72e Keep newlines in Atom feed 2025-05-10 16:55:53 +02:00
f6f47bb9a2 Add RSS feeds section to README 2025-05-10 16:45:08 +02:00
4 changed files with 7835 additions and 306 deletions

View File

@ -1,5 +1,14 @@
# wutheringwaves
## RSS Feeds
Stay updated with the latest Wuthering Waves news through these RSS feeds:
- **[Latest Articles](https://git.lovinator.space/TheLovinator/wutheringwaves/raw/branch/master/articles_latest.xml)** - Contains the 20 newest entries (recommended for regular updates)
- **[Complete Archive](https://git.lovinator.space/TheLovinator/wutheringwaves/raw/branch/master/articles_all.xml)** - Access all published articles (approximately 1 MB)
*Subscribe to these feeds in your favorite RSS reader to automatically receive new announcements.*
## Articles
- [[Chord Cleansing] Limited-Time Echo Double Drop Event](https://wutheringwaves.kurogames.com/en/main/news/detail/2584) [[json]](articles/2584.json)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -294,8 +294,12 @@ def strip_unsafe_tags(content: str) -> str:
str: The cleaned HTML content.
"""
sanitizer = Sanitizer()
return sanitizer.sanitize(content) # pyright: ignore[reportUnknownVariableType, reportUnknownMemberType]
sanitizer = Sanitizer({
"tags": {"a", "br", "b", "strong", "i", "em", "code", "s", "strike", "del", "u"},
"empty": {"a", "br"},
"separate": {"br"},
})
return sanitizer.sanitize(content.replace("\n", "<br>")).replace("<br>", "\n") # pyright: ignore[reportUnknownVariableType, reportUnknownMemberType]
def generate_atom_feed(articles: list[dict[Any, Any]], file_name: str) -> str:
@ -355,7 +359,7 @@ def generate_atom_feed(articles: list[dict[Any, Any]], file_name: str) -> str:
<id>{entry_id}</id>
<title>{escape(article_title)}</title>
<link href="{article_url}" rel="alternate" type="text/html"/>
<content type="html">{escape(article_content)}</content>
<content type="html">{escape(article_content.strip())}</content>
{published}
<updated>{updated}</updated>
{category}