From e5615c557a41331865236235657ab1e8d5e9b0d6 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 3 Jun 2022 09:02:15 +0200 Subject: [PATCH] Update SpellCheck.plugin.js --- Plugins/SpellCheck/SpellCheck.plugin.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Plugins/SpellCheck/SpellCheck.plugin.js b/Plugins/SpellCheck/SpellCheck.plugin.js index d987d528ca..4e31e5d2e1 100644 --- a/Plugins/SpellCheck/SpellCheck.plugin.js +++ b/Plugins/SpellCheck/SpellCheck.plugin.js @@ -2,7 +2,7 @@ * @name SpellCheck * @author DevilBro * @authorId 278543574059057154 - * @version 1.6.2 + * @version 1.6.3 * @description Adds a Spell Check to all Message Inputs. Select a Word and Right Click it to add it to your Dictionary * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,7 +17,7 @@ module.exports = (_ => { "info": { "name": "SpellCheck", "author": "DevilBro", - "version": "1.6.2", + "version": "1.6.3", "description": "Adds a Spell Check to all Message Inputs. Select a Word and Right Click it to add it to your Dictionary" }, "changeLog": { @@ -289,8 +289,8 @@ module.exports = (_ => { spellCheckText (string) { let htmlString = []; let splitter = "!?!?!?!?!?!?!?!" + this.name + BDFDB.NumberUtils.generateId() + this.name + "!?!?!?!?!?!?!?!"; - string.replace(/([0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\"\'\´\`\“\”\‘\’\[\]\(\)\{\}\\\/\&\^\t\r\n])/g, "$1" + splitter).split(splitter).forEach(word => { - let execReturn = /[0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\"\'\´\`\“\”\‘\’\[\]\(\)\{\}\\\/\&\^\t\r\n]$/g.exec(word); + string.replace(/([0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\[\]\(\)\{\}\\\/\&\^\t\r\n])/g, "$1" + splitter).split(splitter).forEach(word => { + let execReturn = /[0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\[\]\(\)\{\}\\\/\&\^\t\r\n]$/g.exec(word); if (execReturn) word = word.slice(0, execReturn[0].length * -1); htmlString.push(`${BDFDB.StringUtils.htmlEscape(word)}`); if (execReturn) htmlString.push(`${execReturn[0]}`); @@ -303,8 +303,8 @@ module.exports = (_ => { toBeReplaced = toBeReplaced.toUpperCase(); let newString = []; let splitter = "!?!?!?!?!?!?!?!" + this.name + BDFDB.NumberUtils.generateId() + this.name + "!?!?!?!?!?!?!?!"; - BDFDB.SlateUtils.toTextValue(editor.children).replace(/([0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\"\'\´\`\“\”\‘\’\[\]\(\)\{\}\\\/\&\^\t\r\n])/g, "$1" + splitter).split(splitter).forEach(word => { - let execReturn = /[0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\"\'\´\`\“\”\‘\’\[\]\(\)\{\}\\\/\&\^\t\r\n]$/g.exec(word); + BDFDB.SlateUtils.toTextValue(editor.children).replace(/([0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\[\]\(\)\{\}\\\/\&\^\t\r\n])/g, "$1" + splitter).split(splitter).forEach(word => { + let execReturn = /[0-9\ \@\>\<\|\,\;\.\:\-\_\=\#\+\*\~\[\]\(\)\{\}\\\/\&\^\t\r\n]$/g.exec(word); if (execReturn) word = word.slice(0, execReturn[0].length * -1); if (word.toUpperCase() == toBeReplaced) { let firstLetter = word.charAt(0);