Corrected invisible whitespace on chromium-based browsers for line-breaks in long words.
This commit is contained in:
parent
2905fa21ac
commit
d7749d3f57
2 changed files with 6 additions and 6 deletions
|
|
@ -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("");
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue