Skip to content

Instantly share code, notes, and snippets.

View bellas-bytes's full-sized avatar

Isabella bellas-bytes

View GitHub Profile
export function updateBodyStorageLinks(
html: string,
dnsOld: string,
dnsNew: string,
idMapping: Record<string, string>
): { html: string; warnings: string[] } {
const escapedDnsOld = dnsOld.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
let warnings: string[] = [];
// Match only <a href="..."> links that contain the old host