From 6ec2124a9c9ea8f1c32b2d41ee57427d2838bb03 Mon Sep 17 00:00:00 2001 From: Chen Shenghan Date: Tue, 24 Apr 2018 02:51:58 +1200 Subject: [PATCH] Fix #1797: In preview window, open external link in external browser. --- browser/components/MarkdownPreview.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index 6e6bb9ec..33e0fa8f 100755 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -523,6 +523,15 @@ export default class MarkdownPreview extends React.Component { } handlelinkClick (e) { + e.preventDefault() + e.stopPropagation() + + const href = e.target.href + if (href.match(/^http/i)) { + shell.openExternal(href) + return + } + const noteHash = e.target.href.split('/').pop() // this will match the new uuid v4 hash and the old hash // e.g.