mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 06:38:23 +00:00
parent
bfb8ac5f5f
commit
0532a3429a
1 changed files with 4 additions and 1 deletions
|
@ -252,10 +252,13 @@
|
|||
|
||||
const baseElement = document.getElementsByTagName('base')[0];
|
||||
|
||||
/** @type {any} */
|
||||
/** @type {*} */
|
||||
let node = event.target;
|
||||
while (node) {
|
||||
if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) {
|
||||
if (node.getAttribute('href').startsWith('#')) {
|
||||
break;
|
||||
}
|
||||
if (node.href.startsWith('file://')) {
|
||||
const [path, fragment] = node.href.replace(/^file:\/\//i, '').split('#');
|
||||
postMessage('_markdown.openDocumentLink', { path, fragment });
|
||||
|
|
Loading…
Reference in a new issue