mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 11:15:14 +00:00
Merge pull request #603 from sveltejs/gh-602
fix handling of empty hrefs during export
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<h1>Great success!</h1>
|
||||
|
||||
<a href="blog">blog</a>
|
||||
<a href="">empty anchor</a>
|
||||
<a href="">empty anchor</a>
|
||||
<a href=''>empty anchor #2</a>
|
||||
<a href=>empty anchor #3</a>
|
||||
<a href= >empty anchor #4</a>
|
||||
<a href>empty anchor #5</a>
|
||||
<a>empty anchor #6</a>
|
||||
|
||||
Reference in New Issue
Block a user