diff --git a/commands/games-sp/will-you-press-the-button.js b/commands/games-sp/will-you-press-the-button.js index 3ff216f6..94ffe84e 100644 --- a/commands/games-sp/will-you-press-the-button.js +++ b/commands/games-sp/will-you-press-the-button.js @@ -1,6 +1,7 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); -const { unescape } = require('html-escaper'); +const Entities = require('html-entities').AllHtmlEntities; +const entities = new Entities(); const { stripIndents } = require('common-tags'); const { verify } = require('../../util/Util'); @@ -29,7 +30,7 @@ module.exports = class WillYouPressTheButtonCommand extends Command { try { const dilemma = await this.fetchDilemma(); await msg.reply(stripIndents` - **${unescape(dilemma.txt1)}** but **${unescape(dilemma.txt2)}** + **${entities.decode(dilemma.txt1)}** but **${entities.decode(dilemma.txt2)}** Will you press the button? _Respond with [y]es or [n]o to continue._ diff --git a/package.json b/package.json index efd32c6b..262dda7c 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "eslint": "^7.11.0", "gifencoder": "^2.0.1", "gm": "^1.23.1", - "html-escaper": "^3.0.0", + "html-entities": "^1.3.1", "js-beautify": "^1.13.0", "mathjs": "^7.5.1", "moment": "^2.29.1", diff --git a/util/Util.js b/util/Util.js index 4eb28330..fdce88f9 100644 --- a/util/Util.js +++ b/util/Util.js @@ -1,5 +1,6 @@ const crypto = require('crypto'); -const { unescape } = require('html-escaper'); +const Entities = require('html-entities').AllHtmlEntities; +const entities = new Entities(); const { SUCCESS_EMOJI_ID } = process.env; const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea', 'ya', 'hai', 'si', 'sí', 'oui', 'はい', 'correct']; const no = ['no', 'n', 'nah', 'nope', 'nop', 'iie', 'いいえ', 'non', 'fuck off']; @@ -206,7 +207,7 @@ module.exports = class Util { static cleanAnilistHTML(html, removeLineBreaks = true) { let clean = html; if (removeLineBreaks) clean = clean.replace(/\r|\n|\f/g, ''); - clean = unescape(clean); + clean = entities.decode(clean); clean = clean .replace(/
/g, '*')