mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Prefer using data-href if it exists on a markdown preview link
Fixes #101203
This commit is contained in:
parent
db170566b8
commit
731f9c2563
File diff suppressed because one or more lines are too long
|
@ -163,12 +163,14 @@ document.addEventListener('click', event => {
|
|||
return;
|
||||
}
|
||||
|
||||
let hrefText = node.getAttribute('data-href');
|
||||
if (!hrefText) {
|
||||
// Pass through known schemes
|
||||
if (passThroughLinkSchemes.some(scheme => node.href.startsWith(scheme))) {
|
||||
return;
|
||||
}
|
||||
|
||||
const hrefText = node.getAttribute('data-href') || node.getAttribute('href');
|
||||
hrefText = node.getAttribute('href');
|
||||
}
|
||||
|
||||
// If original link doesn't look like a url, delegate back to VS Code to resolve
|
||||
if (!/^[a-z\-]+:/i.test(hrefText)) {
|
||||
|
|
Loading…
Reference in a new issue