Merge pull request #603 from sveltejs/gh-602

fix handling of empty hrefs during export
This commit is contained in:
Rich Harris
2019-04-27 12:18:45 -04:00
committed by GitHub
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]);
}