fix parsing links without any attributes after href

This commit is contained in:
azivner 2017-09-03 20:09:17 -04:00
parent de971d5db5
commit f063d12d07

View file

@ -81,9 +81,11 @@ function html2notecase(contents, note) {
} }
} }
const linkMatch = /^<a[^>]+?href="([^"]+?)"[^>]+?>([^<]+?)<\/a>/.exec(curContent); const linkMatch = /^<a[^>]+?href="([^"]+?)"[^>]*?>([^<]+?)<\/a>/.exec(curContent);
if (linkMatch !== null) { if (linkMatch !== null) {
console.log("matched link: ", linkMatch);
const targetUrl = linkMatch[1]; const targetUrl = linkMatch[1];
const linkText = linkMatch[2]; const linkText = linkMatch[2];