Fix open html anchor link in markdown preview (#228633)

use node.getAttribute instead of node.href

Co-authored-by: Gianluca Cappai <gcappai.dev@@gmail.com>
Co-authored-by: Matt Bierner <matb@microsoft.com>
This commit is contained in:
Gianluca Cappai
2024-09-18 23:37:55 +02:00
committed by GitHub
parent 0daa65ac43
commit 59f6431095

View File

@@ -332,11 +332,11 @@ document.addEventListener('click', event => {
let hrefText = node.getAttribute('data-href');
if (!hrefText) {
hrefText = node.getAttribute('href');
// Pass through known schemes
if (passThroughLinkSchemes.some(scheme => node.href.startsWith(scheme))) {
if (passThroughLinkSchemes.some(scheme => hrefText.startsWith(scheme))) {
return;
}
hrefText = node.getAttribute('href');
}
// If original link doesn't look like a url, delegate back to VS Code to resolve