mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Handle new vscode-resource format for md linkes
Fixes #81849 This is a safer scoped fix, not the best one. Will look into removing most of this uri munging for october
This commit is contained in:
parent
e28affc16b
commit
2235ebf5db
File diff suppressed because one or more lines are too long
|
@ -141,7 +141,11 @@ document.addEventListener('click', event => {
|
|||
break;
|
||||
}
|
||||
if (node.href.startsWith('file://') || node.href.startsWith('vscode-resource:') || node.href.startsWith(settings.webviewResourceRoot)) {
|
||||
const [path, fragment] = node.href.replace(/^(file:\/\/|vscode-resource:)/i, '').replace(new RegExp(`^${escapeRegExp(settings.webviewResourceRoot)}`)).split('#');
|
||||
const [path, fragment] = node.href
|
||||
.replace(/^file:\/\//i, '')
|
||||
.replace(/^vscode-resource:\/\/[^\/]+\//i, '')
|
||||
.replace(new RegExp(`^${escapeRegExp(settings.webviewResourceRoot)}`))
|
||||
.split('#');
|
||||
messaging.postMessage('clickLink', { path, fragment });
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
|
Loading…
Reference in a new issue