Fix spacing on messages with links.

This commit is contained in:
armored-dragon 2025-01-22 23:12:03 -06:00
parent 5586df1a93
commit d518c12cf9
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
2 changed files with 2 additions and 3 deletions

View file

@ -189,7 +189,6 @@ Rectangle {
}
}
ListModel {
id: local
}

View file

@ -56,7 +56,7 @@ const formatting = {
if (firstMatch == null) {
// If there is no more text to parse, break out of the loop and return the message array.
// Format any remaining text as a basic 'text' type.
messageArray.push({type: 'text', value: runningMessage});
if (runningMessage.trim() != "") messageArray.push({type: 'text', value: runningMessage});
// Append a final 'fill width' to the message text.
messageArray.push({type: 'messageEnd'});
@ -95,7 +95,7 @@ const formatting = {
let foundMatch = runningMessage.match(regex)[0];
messageArray.push({type: 'text', value: runningMessage.substring(0, indexOfFirstMatch)});
if (runningMessage.substring(0, indexOfFirstMatch) != "") messageArray.push({type: 'text', value: runningMessage.substring(0, indexOfFirstMatch)});
messageArray.push({type: regexPatterns[firstMatch[1]].type, value: runningMessage.substring(indexOfFirstMatch, indexOfFirstMatch + foundMatch.length)});
runningMessage = runningMessage.substring(indexOfFirstMatch + foundMatch.length); // Remove the part of the message we have worked with