How to use the remarkable/lib/common/utils.replaceEntities function in remarkable

To help you get started, we’ve selected a few remarkable 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 calpa / gatsby-starter-calpa-blog / src / api / text.js View on Github external
md.renderer.rules.link_open = (tokens, idx) => {
    const title = tokens[idx].title
      ? ` title="${escapeHtml(replaceEntities(tokens[idx].title))}"`
      : '';
    const href = escapeHtml(tokens[idx].href);
    const isExternal = href.charAt(0) !== '/';
    const target = isExternal ? 'target="_blank"' : '';
    const rel = isExternal ? 'rel="external nofollow noopener"' : '';
    return `<a href="${href}">`;
  };
</a>
github deckgo / deckdeckgo / webpack / src / markdown / deckdeckgo-markdown-plugin.ts View on Github external
const imageRule = () =&gt; (tokens, idx, options, env) =&gt; {
                const src: string = ' data-src="' + escapeHtml(tokens[idx].src) + '"';
                const title: string = tokens[idx].title ? (' title="' + escapeHtml(replaceEntities(tokens[idx].title)) + '"') : '';
                const alt: string = ' alt="' + (tokens[idx].alt ? escapeHtml(replaceEntities(unescapeMd(tokens[idx].alt))) : '') + '"';
                const suffix: string = options.xhtmlOut ? ' /' : '';
                return '';
            };

remarkable

Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.

MIT
Latest version published 4 years ago

Package Health Score

80 / 100
Full package analysis