From 0fe83a0583de2561c6d6a9b8ab51bd0226ad49d5 Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Mon, 25 Jan 2016 10:28:46 +0900 Subject: [PATCH] fix anchor target --- browser/components/MarkdownPreview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index ed10cc4e..b9133679 100644 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -49,12 +49,12 @@ const sanitizeOpts = { } function handleAnchorClick (e) { - if (e.target.attributes.href && e.target.attributes.href.nodeValue.match(/#.+/)) { + if (this.attributes.href && this.attributes.href.nodeValue.match(/^#.+/)) { return } e.preventDefault() e.stopPropagation() - let href = e.target.href + let href = this.href if (href && href.match(/^http:\/\/|https:\/\/|mailto:\/\//)) { shell.openExternal(href) }