From 16e574a08362acde583ca370183a2b1aed537087 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sun, 28 Sep 2025 14:56:05 +0800 Subject: [PATCH] Fix query mode prefix regex to handle multiline queries in WebUI - Allow newlines in query text - Change `.+` to `[\s\S]+` in regex - Support multiline input parsing - Fix prefix matching edge case --- lightrag_webui/src/features/RetrievalTesting.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag_webui/src/features/RetrievalTesting.tsx b/lightrag_webui/src/features/RetrievalTesting.tsx index 6db83390..c96541aa 100644 --- a/lightrag_webui/src/features/RetrievalTesting.tsx +++ b/lightrag_webui/src/features/RetrievalTesting.tsx @@ -158,7 +158,7 @@ export default function RetrievalTesting() { // Parse query mode prefix const allowedModes: QueryMode[] = ['naive', 'local', 'global', 'hybrid', 'mix', 'bypass'] - const prefixMatch = inputValue.match(/^\/(\w+)\s+(.+)/) + const prefixMatch = inputValue.match(/^\/(\w+)\s+([\s\S]+)/) let modeOverride: QueryMode | undefined = undefined let actualQuery = inputValue