We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#
1 parent cb7900c commit 088fa34Copy full SHA for 088fa34
src/prerender.ts
@@ -384,6 +384,7 @@ function extractLinks(
384
_links.push(
385
...[...html.matchAll(LINK_REGEX)]
386
.map((m) => escapeHtml(m[1]))
387
+ .filter((m) => !decodeURIComponent(m).startsWith("#"))
388
.filter((link) => allowedExtensions.has(getExtension(link)))
389
);
390
}
test/fixture/routes/prerender.ts
@@ -39,6 +39,8 @@ ${links.map((link) => ` <li><a href="${link}">${link}</a></li>`).join("\n")}
39
<link rel="icon" href="data:image/png;base64,aaa//bbbbbb/ccc">
40
<a x-href="/500?x-href">x-href attr</a>
41
<a href="/500</a>
42
+ <a href='#a'>#a</a>
43
+ <a href='%23b'>#b</a>
44
</body>
45
</html>`;
46
});
0 commit comments