[server links] forward / backward slashes

This commit is contained in:
JakubPapso committed 2024-07-11 11:35:01 +02:00
1 parent 4de8ffec1b
commit 3e23b72257
1 file changed
+4 -1
@@ -31,13 +31,16 @@ export function prepareHTMLDescription(description) {
description = description.replace(/\\\\/g, 'smb://')
// find all smb links and replace them with clickable links, separated by ' ', '<', '>', '"', and '(', ')' characters
description = description.replace(/(smb:\/\/[^\s<>"()]+)/g, '<a href="$1">$1</a>')
description = description = description.replace(/(smb:\/\/[^\s<>"()]+)/g, function(match) {
return '<a href="' + match.replace(/\\/g, '/') + '">' + match.replace(/\\/g, '/') + '</a>'
})
} else {
description = description.replace(/smb:\/\//g, '\\\\')
// find all windows links and replace them with clickable links, separated by ' ', '<', '>', '"', and '(', ')' characters
description = description.replace(/(\\\\[^\s<>"()]+)/g, function(match) {
match = match.replaceAll('/', '\\')
return '<span style="cursor: pointer; text-decoration: underline" onclick="' + getCopyFunction(match) + '">' + match + '</span>';
});
}