From d518c12cf9343d7b411ebace8fc2d436e320031a Mon Sep 17 00:00:00 2001 From: armored-dragon Date: Wed, 22 Jan 2025 23:12:03 -0600 Subject: [PATCH] Fix spacing on messages with links. --- scripts/system/domainChat/domainChat.qml | 1 - scripts/system/domainChat/formatting.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/system/domainChat/domainChat.qml b/scripts/system/domainChat/domainChat.qml index be4b6d4f79..28ec98d390 100644 --- a/scripts/system/domainChat/domainChat.qml +++ b/scripts/system/domainChat/domainChat.qml @@ -189,7 +189,6 @@ Rectangle { } } - ListModel { id: local } diff --git a/scripts/system/domainChat/formatting.js b/scripts/system/domainChat/formatting.js index 24662e4ff1..c534f3a720 100644 --- a/scripts/system/domainChat/formatting.js +++ b/scripts/system/domainChat/formatting.js @@ -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