Integrated Manticore sync, assuming responsibility from traxxx core/legacy.
This commit is contained in:
7
utils/filter-title.js
Normal file
7
utils/filter-title.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function filterTitle(title, keys) {
|
||||
if (!title) {
|
||||
return title;
|
||||
}
|
||||
|
||||
return keys.reduce((accTitle, tag) => accTitle.replace(new RegExp(`\\b${tag.replace(/[^\w\s]+/g, '')}\\b`, 'gi'), ''), title).trim().replace(/\s{2,}/, ' ');
|
||||
}
|
||||
Reference in New Issue
Block a user