From 96f316ac26f47f5aa226f21c20955e906d889089 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 11 Jan 2026 13:53:34 +0100 Subject: [PATCH] Normalize transcribed text by replacing line breaks and spaces --- app/MindWork AI Studio/Components/VoiceRecorder.razor.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs b/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs index e7abf071..191f2f97 100644 --- a/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs +++ b/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs @@ -249,6 +249,12 @@ public partial class VoiceRecorder : MSGComponentBase await this.MessageBus.SendWarning(new(Icons.Material.Filled.VoiceChat, this.T("The transcription result is empty."))); return; } + + // Replace line breaks with spaces: + transcribedText = transcribedText.Replace("\r", " ").Replace("\n", " "); + + // Replace two spaces with a single space: + transcribedText = transcribedText.Replace(" ", " "); this.Logger.LogInformation("Transcription completed successfully. Result length: {Length} characters.", transcribedText.Length);