Skip to content

extractLinks

Extracts the values of every href/src attribute in a chunk of HTML.

Import:

import { extractLinks } from '@mnaoumov/typescript-dev-toolkit/docs-site/link-check';

Signature:

function extractLinks(html: string): string[]

Parameters:

Parameter Type Description
html string The HTML to scan.

Returns: string[] — The raw link values, in document order (duplicates preserved).