Closed yhatt closed 1 year ago
VS Code has owned link renderer to add data-href attribute to every hyperlinks. https://github.com/microsoft/vscode/blob/6a025483bda7044f1949ca9ee027969eb917de80/extensions/markdown-language-features/src/markdownEngine.ts#L330-L346
data-href
This was not important in not so long ago because the Electron frame could trap every page navigations. But in recent VS Code, it becomes important to trap <a> links because VS Code covers Web now.
<a>
We've updated to apply VS Code's link renderer when rendering Marp Markdown in the preview. <a href="https://example.com"> will render as <a href="https://example.com" data-href="https://example.com">, and VS Code built-in preview becomes able to trap links rendered by Marp. https://github.com/microsoft/vscode/blob/6a025483bda7044f1949ca9ee027969eb917de80/extensions/markdown-language-features/preview-src/index.ts#L333-L348
<a href="https://example.com">
<a href="https://example.com" data-href="https://example.com">
Resolves marp-team/marp#461.
VS Code has owned link renderer to add
data-href
attribute to every hyperlinks. https://github.com/microsoft/vscode/blob/6a025483bda7044f1949ca9ee027969eb917de80/extensions/markdown-language-features/src/markdownEngine.ts#L330-L346This was not important in not so long ago because the Electron frame could trap every page navigations. But in recent VS Code, it becomes important to trap
<a>
links because VS Code covers Web now.We've updated to apply VS Code's link renderer when rendering Marp Markdown in the preview.
<a href="https://example.com">
will render as<a href="https://example.com" data-href="https://example.com">
, and VS Code built-in preview becomes able to trap links rendered by Marp. https://github.com/microsoft/vscode/blob/6a025483bda7044f1949ca9ee027969eb917de80/extensions/markdown-language-features/preview-src/index.ts#L333-L348Resolves marp-team/marp#461.