path recognition in ui fix
frdel committed
Jan 18, 2025 at 23:05 UTC
04fdc67746a7da31a49dc2b1d8d52ea6eb6186d9
1 file changed
+3
-3
webui/js/messages.js
+3
-3
@@ -629,9 +629,9 @@ function convertPathsToLinks(str) {
629
return html;
630
}
631
632
- const prefix = `(?:[ \`'"\\n]|'|")`; // Use a non-capturing group for OR logic
633
- const folder = `[a-zA-Z0-9_\\/\\.]`; // Characters allowed in folder names
634
- const file = `[a-zA-Z0-9_\\/]`; // Characters allowed in file names
632
+ const prefix = `(?:^|[ \`'"\\n]|'|")`; // Use a non-capturing group for OR logic
633
+ const folder = `[a-zA-Z0-9_\\/.\\-]`; // Characters allowed in folder chain
634
+ const file = `[a-zA-Z0-9_\\-\\/]`; // Characters allowed in file names
635
const suffix = `(?<!\\.)`
636
637
const regex = new RegExp(`(?<=${prefix})\\/${folder}*${file}${suffix}`, 'g');