Merge pull request #491 from sveltejs/empty-href-export

ignore empty anchors when exporting
This commit is contained in:
Rich Harris
2018-10-24 15:51:28 -04:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

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

View File

@@ -1,3 +1,4 @@
<h1>Great success!</h1> <h1>Great success!</h1>
<a href="blog">blog</a> <a href="blog">blog</a>
<a href="">empty anchor</a>