How to use the dmd/helpers/ddata.parseLink function in dmd

To help you get started, we’ve selected a few dmd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-builder / scripts / jsdoc / helpers.js View on Github external
function parseLink(text) {
  return dmdHelpers.parseLink(text)
}
github apifytech / apify-js / website / tools / helpers.js View on Github external
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;
};