提交 2235ebf5 编写于 作者: M Matt Bierner

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
上级 e28affc1
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册