[education/labplot] src/frontend/script: [scripting] improved html formatting.

Alexander Semke <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 3db0a8025cc243707598737cf48b608f4d43dc1d by Alexander Semke.
Committed on 28/07/2026 at 14:43.
Pushed by asemke into branch 'master'.

[scripting] improved html formatting.

M  +6    -6    src/frontend/script/ScriptEditor.cpp

https://invent.kde.org/education/labplot/-/commit/3db0a8025cc243707598737cf48b608f4d43dc1d

diff --git a/src/frontend/script/ScriptEditor.cpp b/src/frontend/script/ScriptEditor.cpp
index dc2026381e..bdcc27643c 100644
--- a/src/frontend/script/ScriptEditor.cpp
+++ b/src/frontend/script/ScriptEditor.cpp
@@ -267,17 +267,17 @@ QString ScriptEditor::processOutputText(bool isErr, const QString& text) {
 
 	// Apply color formatting
 	if (isErr) {
-		// Error output - make it red
-		html = QStringLiteral("<span style=\"color: #d32f2f;\">%1</span>").arg(processedText);
+		// Error output - make it red with line breaks preserved
+		html = QStringLiteral("<span style=\"color: #d32f2f; white-space: pre-wrap;\">%1</span>").arg(processedText);
 	} else if (warningPattern.match(text).hasMatch()) {
 		// Warning - make it orange
-		html = QStringLiteral("<span style=\"color: #f57c00;\">%1</span>").arg(processedText);
+		html = QStringLiteral("<span style=\"color: #f57c00; white-space: pre-wrap;\">%1</span>").arg(processedText);
 	} else if (errorPattern.match(text).hasMatch()) {
 		// Exception names - make them red
-		html = QStringLiteral("<span style=\"color: #d32f2f;\">%1</span>").arg(processedText);
+		html = QStringLiteral("<span style=\"color: #d32f2f; white-space: pre-wrap;\">%1</span>").arg(processedText);
 	} else {
-		// Normal output
-		html = processedText;
+		// Normal output - wrap in span to ensure consistent rendering
+		html = QStringLiteral("<span style=\"white-space: pre-wrap;\">%1</span>").arg(processedText);
 	}
 
 	DEBUG(Q_FUNC_INFO << ", Generated HTML: " << html.toStdString())
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.