mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-18 13:35:08 +00:00
fix handling of empty hrefs during export (#602)
This commit is contained in:
@@ -212,6 +212,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 && (match[1] || match[2] || match[3]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<h1>Great success!</h1>
|
<h1>Great success!</h1>
|
||||||
|
|
||||||
<a href="blog">blog</a>
|
<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