From d480c586d090ea83561f1664ef45c91da2e6697c Mon Sep 17 00:00:00 2001 From: BlakeNeko Date: Thu, 18 Dec 2025 11:39:18 +0800 Subject: [PATCH] feat: Implement trim surrounding spaces --- web/js/auto-formatter.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/js/auto-formatter.js b/web/js/auto-formatter.js index 44dca74..f016320 100644 --- a/web/js/auto-formatter.js +++ b/web/js/auto-formatter.js @@ -70,6 +70,11 @@ function shouldAutoFormat(text, nodeInfo) { export function formatPromptText(text) { if (!text || text.trim().length === 0) return text; + // Trim surrounding spaces of the entire prompt if the setting is enabled + if (settingValues.trimSurroundingSpaces) { + text = text.trim(); + } + // Split text into individual lines for processing const lines = text.split('\n'); const formattedLines = [];