in scripts/merge_md.js [59:76]
function replaceLink(match, linkName, link, frag) {
if (link.startsWith('http')) {
return match;
} else if (/\.(png|jpeg|svg|gif|jpg)$/.test(link)) {
const imgLink = link.replace(/\/images\//, './static/images/');
return `[${linkName}](${imgLink})`;
} else {
if (link.includes('.md#') && frag) {
return frag.replace(/[\s]+/g, '-').toLowerCase();
} else {
let fullPath = path.join(docsBaseDir, customResolve(link));
if (!link.endsWith('.md')) {
fullPath += '.md';
}
return `[${linkName}](#${getMainTitleFromFile(fullPath).replace(/[\s]+/g, '-').toLowerCase()})`;
}
}
}