diff --git a/src/api/export.ts b/src/api/export.ts index ba6a9db..1d1be4c 100644 --- a/src/api/export.ts +++ b/src/api/export.ts @@ -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]); } diff --git a/test/apps/export/src/routes/index.svelte b/test/apps/export/src/routes/index.svelte index cdeb5a8..1928902 100644 --- a/test/apps/export/src/routes/index.svelte +++ b/test/apps/export/src/routes/index.svelte @@ -1,4 +1,9 @@

Great success!

blog -empty anchor \ No newline at end of file +empty anchor +empty anchor #2 +empty anchor #3 +empty anchor #4 +empty anchor #5 +empty anchor #6