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
This commit is contained in:
yangdx 2025-09-28 14:56:05 +08:00
parent 0fd0186414
commit 16e574a083

View file

@ -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