Skip to content

Commit

Permalink
fix: Fix link filtering logic in fetchPage function
Browse files Browse the repository at this point in the history
  • Loading branch information
OXeu committed Jun 7, 2024
1 parent d77cb05 commit 3ea4d40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function fetchPage(url: string) {
const anchors = Array.from(document.querySelectorAll('a'));
return anchors.map(anchor => anchor.href);
});
for (const link of links.filter(link => (link.startsWith(baseUrl) || link.includes(containsKey)))) {
for (const link of links.filter(link => (link.startsWith(baseUrl) || (containsKey != '' && link.includes(containsKey))))) {
const linkWithoutHash = link.split('#')[0];
if (fetchedLinks.has(linkWithoutHash)) {
continue;
Expand Down

0 comments on commit 3ea4d40

Please sign in to comment.