if (!/^(#|\/\/|http(s)?:)/.test(href) && !relative_link && prependRoot) { if (!href.startsWith('/') && !href.startsWith('\\') && postPath) { constPostAsset = hexo.model('PostAsset'); // findById requires forward slash const asset = PostAsset.findById(join(postPath, href.replace(/\\/g, '/'))); // asset.path is backward slash in Windows if (asset) href = asset.path.replace(/\\/g, '/'); } href = url_for.call(hexo, href); }
let out = `<img src="${encodeURL(href)}" referrerpolicy="no-referrer"`; if (text) out += ` alt="${escape(text)}"`; if (title) out += ` title="${escape(title)}"`; if (lazyload) out += ' loading="lazy"';
out += '>'; if (figcaption && text) { return`<figure>${out}<figcaption aria-hidden="true">${text}</figcaption></figure>`; } return out; }