提交 d7da141b 编写于 作者: E Eric Amodio 提交者: Matt Bierner

Allows action on links with embedded tags (#29082)

e.g. code tags
上级 4f266936
......@@ -146,12 +146,18 @@ export function renderMarkdown(markdown: IMarkdownString, options: RenderOptions
if (options.actionCallback) {
DOM.addStandardDisposableListener(element, 'click', event => {
if (event.target.tagName === 'A') {
const href = event.target.dataset['href'];
if (href) {
options.actionCallback(href, event);
let target = event.target;
if (target.tagName !== 'A') {
target = target.parentElement;
if (!target || target.tagName !== 'A') {
return;
}
}
const href = target.dataset['href'];
if (href) {
options.actionCallback(href, event);
}
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册