提交 98395bd1 编写于 作者: J Johannes Rieken

make sure to always prevent default when clicking links

上级 087ee56e
......@@ -12,6 +12,7 @@ import { removeMarkdownEscapes, IMarkdownString } from 'vs/base/common/htmlConte
import * as marked from 'vs/base/common/marked/marked';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { IDisposable } from 'vs/base/common/lifecycle';
import { onUnexpectedError } from 'vs/base/common/errors';
export interface IContentActionHandler {
callback: (content: string, event?: IMouseEvent) => void;
......@@ -152,12 +153,16 @@ export function renderMarkdown(markdown: IMarkdownString, options: RenderOptions
return;
}
}
const href = target.dataset['href'];
if (href) {
options.actionHandler.callback(href, event);
try {
const href = target.dataset['href'];
if (href) {
options.actionHandler.callback(href, event);
}
} catch (err) {
onUnexpectedError(err);
} finally {
event.preventDefault();
}
event.preventDefault();
}));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册