This commit is contained in:
Daniel Odendahl Jr
2019-02-16 02:50:37 +00:00
parent c7aaf4b5ce
commit d535db7a08
4 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -124,7 +124,8 @@ module.exports = class Util {
.replace(/"/g, '"')
.replace(/<\/?i>/g, '*')
.replace(/~!|!~/g, '||');
const spoilers = (clean.substr(0, 1997).match(/\|\|/g) || []).length;
if (clean.length > 2000) clean = `${clean.substr(0, 1995)}...`;
const spoilers = (clean.match(/\|\|/g) || []).length;
if (spoilers !== 0 && (spoilers && (spoilers % 2))) clean += '||';
return clean;
}