MCPcopy
hub / github.com/TanStack/router / extractLinks

Function extractLinks

packages/start-plugin-core/src/prerender.ts:114–127  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

112 }
113
114 function extractLinks(html: string): Array<string> {
115 const linkRegex = /<a[^>]+href=["']([^"']+)["'][^>]*>/g
116 const links: Array<string> = []
117 let match
118
119 while ((match = linkRegex.exec(html)) !== null) {
120 const href = match[1]
121 if (href && (href.startsWith('/') || href.startsWith('./'))) {
122 links.push(href)
123 }
124 }
125
126 return links
127 }
128
129 async function prerenderPages({ outputDir }: { outputDir: string }) {
130 const seen = new Set<string>()

Callers 1

addCrawlPageTaskFunction · 0.85

Calls 2

startsWithMethod · 0.80
execMethod · 0.65

Tested by

no test coverage detected