How to use the remarkable/lib/common/utils.unescapeMd 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 Snugug / gulp-armadillo / lib / helpers / markdown / plugins / fence.js View on Github external
module.exports = function (tokens, idx, options) {
  const token = tokens[idx];
  let langClass = '';
  const langPrefix = options.langPrefix;
  let langName = '';
  let fenceName = '';

  if (token.params) {
    fenceName = token.params.split(/\s+/g)[0];
    langName = utils.escapeHtml(utils.replaceEntities(utils.unescapeMd(fenceName)));
    langClass = langName ? `class="${langPrefix}${langName}"` : '';
  }

  const highlighted = options.highlight(token.content, langName) || utils.escapeHtml(token.content);

  return `<pre><code>${highlighted}</code></pre>${this.getBreak(tokens, idx)}`;
};
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 '';
            };
github quiltdata / quilt / catalog / app / components / Markdown / Markdown.js View on Github external
md.renderer.rules.image = (tokens, idx) =&gt; {
    const t = process(tokens[idx])

    if (disable) {
      const alt = t.alt ? escape(t.alt) : ''
      const src = escape(t.src)
      const title = t.title ? ` "${escape(t.title)}"` : ''
      return `<span>![${alt}](${src}${title})</span>`
    }

    const src = escapeHtml(t.src)
    const alt = t.alt ? escape(unescapeMd(t.alt)) : ''
    const title = t.title ? ` title="${escape(t.title)}"` : ''
    return `<img alt="${alt}" src="${src}">`
  }
}

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