From f063d12d0729d2609336889d70959131590c7f1a Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 3 Sep 2017 20:09:17 -0400 Subject: [PATCH] fix parsing links without any attributes after href --- static/js/html2notecase.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/html2notecase.js b/static/js/html2notecase.js index 3c161fce2..e8e4c230e 100644 --- a/static/js/html2notecase.js +++ b/static/js/html2notecase.js @@ -81,9 +81,11 @@ function html2notecase(contents, note) { } } - const linkMatch = /^]+?href="([^"]+?)"[^>]+?>([^<]+?)<\/a>/.exec(curContent); + const linkMatch = /^]+?href="([^"]+?)"[^>]*?>([^<]+?)<\/a>/.exec(curContent); if (linkMatch !== null) { + console.log("matched link: ", linkMatch); + const targetUrl = linkMatch[1]; const linkText = linkMatch[2];