Skip to content

Commit

Permalink
fix(prerender): use pathname from extracted links only (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz authored Apr 11, 2022
1 parent 762f917 commit b9271d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/prerender.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { resolve, relative, join } from 'pathe'
import { parseURL } from 'ufo'
import { createNitro } from './nitro'
import { build } from './build'
import type { Nitro } from './types'
Expand Down Expand Up @@ -79,7 +80,7 @@ const LINK_REGEX = /href=['"]?([^'" >]+)/g
function extractLinks (html: string, _url: string) {
const links: string[] = []
for (const match of html.matchAll(LINK_REGEX)) {
links.push(match[1])
links.push(parseURL(match[1]).pathname)
}
return links
}
Expand Down

0 comments on commit b9271d7

Please sign in to comment.