Replace em dashes (—) in AniList descriptions

This commit is contained in:
Dragon Fire
2019-07-29 13:15:14 -04:00
parent cbcd665cd5
commit 838ce090fd
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "107.4.0",
"version": "107.4.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {
+2 -1
View File
@@ -96,7 +96,8 @@ module.exports = class Util {
.replace(/'/g, '\'')
.replace(/"/g, '"')
.replace(/<\/?i>/g, '*')
.replace(/~!|!~/g, '||');
.replace(/~!|!~/g, '||')
.replace(/&mdash;/g, '—');
if (clean.length > 2000) clean = `${clean.substr(0, 1995)}...`;
const spoilers = (clean.match(/\|\|/g) || []).length;
if (spoilers !== 0 && (spoilers && (spoilers % 2))) clean += '||';