fix handling of empty hrefs during export (#602)

This commit is contained in:
Conduitry
2019-03-11 10:39:35 -04:00
parent 7be7e1eb9f
commit 6d5aa9a35d
2 changed files with 8 additions and 3 deletions

View File

@@ -212,6 +212,6 @@ async function _export({
}
function get_href(attrs: string) {
const match = /href\s*=\s*(?:"(.*?)"|'(.+?)'|([^\s>]+))/.exec(attrs);
return match[1] || match[2] || match[3];
const match = /href\s*=\s*(?:"(.*?)"|'(.*?)'|([^\s>]*))/.exec(attrs);
return match && (match[1] || match[2] || match[3]);
}