Cleanup prohibited words filter code and test data

This commit is contained in:
rejas 2021-04-24 21:59:16 +02:00 committed by veeck
parent dcec778e02
commit e9de961a23
2 changed files with 212 additions and 212 deletions

View File

@ -186,9 +186,9 @@ Module.register("newsfeed", {
} }
if (this.config.prohibitedWords.length > 0) { if (this.config.prohibitedWords.length > 0) {
newsItems = newsItems.filter(function (value) { newsItems = newsItems.filter(function (item) {
for (let word of this.config.prohibitedWords) { for (let word of this.config.prohibitedWords) {
if (value["title"].toLowerCase().indexOf(word.toLowerCase()) > -1) { if (item.title.toLowerCase().indexOf(word.toLowerCase()) > -1) {
return false; return false;
} }
} }

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" <?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
@ -6,7 +7,6 @@
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> >
<channel> <channel>
<title>Rodrigo Ramírez Norambuena</title> <title>Rodrigo Ramírez Norambuena</title>
<atom:link href="https://rodrigoramirez.com/feed/" rel="self" type="application/rss+xml"/> <atom:link href="https://rodrigoramirez.com/feed/" rel="self" type="application/rss+xml"/>