From 60fbb7db5d48d95ff0ad3c343dd403fb61f2f256 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Sun, 14 Jun 2020 02:22:37 +0200 Subject: [PATCH] fix unclickable links --- browser/components/MarkdownPreview.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index 9ddea3187..96b7e0654 100755 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -1192,7 +1192,10 @@ class MarkdownPreview extends React.Component { e.preventDefault() e.stopPropagation() - const rawHref = e.target.getAttribute('href') + const el = e.target.closest('a[href]') + if (!el) return + + const rawHref = el.getAttribute('href') const { dispatch } = this.props if (!rawHref) return // not checked href because parser will create file://... string for [empty link]()