Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseLink(text) {
return dmdHelpers.parseLink(text)
}
exports.inlineLinks = (text, options) => {
if (text) {
const links = ddata.parseLink(text);
links.forEach((link) => {
const linked = ddata._link(link.url, options);
if (link.caption === link.url) link.caption = linked.name;
if (linked.url) link.url = linked.url;
const url = link.url.includes('+') ? link.url : link.url.toLowerCase();
text = text.replace(link.original, `[\`${link.caption}\`](${url})`);
});
}
return text;
};