Makes all link hrefs absolute in HTML content.
Finds all <a> tags and converts their href attributes from relative to absolute URLs using the provided hostname.
<a>
href
The base hostname/URL for resolving relative paths
The HTML content to process
HTML with all link hrefs converted to absolute URLs
const html = '<a href="/about">About</a>';makeLinksAbsolute('https://example.com', html);// Returns: '<a href="https://example.com/about">About</a>' Copy
const html = '<a href="/about">About</a>';makeLinksAbsolute('https://example.com', html);// Returns: '<a href="https://example.com/about">About</a>'
Makes all link hrefs absolute in HTML content.
Finds all
<a>tags and converts theirhrefattributes from relative to absolute URLs using the provided hostname.