Spaces:
Paused
Paused
frdel commited on
Commit ·
dcd3ab7
1
Parent(s): 0521d32
path recognition in ui fix
Browse files- webui/js/messages.js +3 -3
webui/js/messages.js
CHANGED
|
@@ -629,9 +629,9 @@ function convertPathsToLinks(str) {
|
|
| 629 |
return html;
|
| 630 |
}
|
| 631 |
|
| 632 |
-
const prefix = `(
|
| 633 |
-
const folder = `[a-zA-Z0-9_
|
| 634 |
-
const file = `[a-zA-Z0-9_
|
| 635 |
const suffix = `(?<!\\.)`
|
| 636 |
|
| 637 |
const regex = new RegExp(`(?<=${prefix})\\/${folder}*${file}${suffix}`, 'g');
|
|
|
|
| 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 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');
|