Merge from vscode 70dc55955d586ebd427658b43cdb344f2047f9c2 (#6789)

This commit is contained in:
Anthony Dresser
2019-08-16 21:47:46 -07:00
committed by GitHub
parent fb26126bcb
commit 41d8663b09
79 changed files with 1815 additions and 572 deletions

View File

@@ -157,8 +157,9 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
};
}
if (options.actionHandler) {
options.actionHandler.disposeables.add(DOM.addStandardDisposableListener(element, 'click', event => {
const actionHandler = options.actionHandler;
if (actionHandler) {
actionHandler.disposeables.add(DOM.addStandardDisposableListener(element, 'click', event => {
let target: HTMLElement | null = event.target;
if (target.tagName !== 'A') {
target = target.parentElement;
@@ -169,7 +170,7 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
try {
const href = target.dataset['href'];
if (href) {
options.actionHandler!.callback(href, event);
actionHandler.callback(href, event);
}
} catch (err) {
onUnexpectedError(err);