Makes all image source paths absolute in HTML content.
Finds all <img> tags and converts their src attributes from relative to absolute URLs using the provided hostname.
<img>
src
The base hostname/URL for resolving relative paths
The HTML content to process
HTML with all image paths converted to absolute URLs
const html = '<img src="/logo.png">';makeImgPathsAbsolute('https://example.com', html);// Returns: '<img src="https://example.com/logo.png">' Copy
const html = '<img src="/logo.png">';makeImgPathsAbsolute('https://example.com', html);// Returns: '<img src="https://example.com/logo.png">'
Makes all image source paths absolute in HTML content.
Finds all
<img>tags and converts theirsrcattributes from relative to absolute URLs using the provided hostname.