This commit is contained in:
Dragon Fire
2021-01-03 10:08:38 -05:00
parent e789dee33a
commit 34cd6d65fa
2 changed files with 4 additions and 6 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
const crypto = require('crypto');
const Entities = require('html-entities').AllHtmlEntities;
const entities = new Entities();
const { decode: decodeHTML } = require('html-entities');
const { stripIndents } = require('common-tags');
const { SUCCESS_EMOJI_ID } = process.env;
const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea', 'ya', 'hai', 'si', 'sí', 'oui', 'はい', 'correct'];
@@ -270,7 +269,7 @@ module.exports = class Util {
static cleanAnilistHTML(html, removeLineBreaks = true) {
let clean = html;
if (removeLineBreaks) clean = clean.replace(/\r|\n|\f/g, '');
clean = entities.decode(clean);
clean = decodeHTML(clean);
clean = clean
.replaceAll('<br>', '\n')
.replace(/<\/?i>/g, '*')