Update SpellCheck.plugin.js

This commit is contained in:
Mirco Wittrien 2022-06-03 09:02:15 +02:00 committed by GitHub
parent d66b3ecc67
commit e5615c557a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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(`<span class="${this.isWordNotInDictionary(word) ? BDFDB.disCN._spellcheckerror : ""}" style="color: transparent !important; text-shadow: none !important;">${BDFDB.StringUtils.htmlEscape(word)}</span>`);
if (execReturn) htmlString.push(`<span>${execReturn[0]}</span>`);
@ -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);