Corrected invisible whitespace on chromium-based browsers for line-breaks in long words.

This commit is contained in:
rainbow napkin 2026-05-17 18:56:59 -04:00
parent 49684b32a1
commit 9f52d13bde
2 changed files with 6 additions and 6 deletions

View file

@ -144,7 +144,7 @@ class chatPostprocessor{
//with negative lookaheads to exclude file seperators so we don't split link placeholders, dashes so we dont split usernames and other things, and accented characters to keep those from splitting boundries too
//Also split by any invisble whitespace as a crutch to handle mushed links/emotes
//If we can one day figure out how to split non-repeating special chars instead of special chars with whitespace, that would be perf, unfortunately my brain hasn't rotted enough to understand regex like that just yet.
const splitString = utils.unescapeEntities(this.rawData.msg).split(/(?<!-)(?<!␜)(?=\w)\b|(?!-|[\u00C0-\u017F])(?<=\w)\b|(?=\s)\B|(?<=\s)\B|/g);
const splitString = utils.unescapeEntities(this.rawData.msg).split(/(?<!-)(?<!␜)(?=\w)\b|(?!-|[\u00C0-\u017F])(?<=\w)\b|(?=\s)\B|(?<=\s)\B|/g);
//for each word in the splitstring
splitString.forEach((string) => {
@ -474,7 +474,7 @@ class chatPostprocessor{
//After eight characters
if(charIndex > 8){
//Push an invisible line-break character between every character
wordArray.push("");
wordArray.push("");
}
});