How to use the remarkable.utils.escapeHtml 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 HHogg / remarkable-react / demo / CodeHighlighted.js View on Github external
render() {
    const { children, params, options } = this.props;
    let fences
    let className;
    let content = utils.escapeHtml(children);

    if (params) {
      fences = params.split(/\s+/g);
      className = `hljs ${options.langPrefix}${utils.escapeHtml(
        utils.replaceEntities(utils.unescapeMd(fences.join(' ')))
      )}`;

      if (options.highlight) {
        content = options.highlight.apply(
          options.highlight, [content].concat(fences)) || content;
      }
    }

    return (
      <code>
    );
  }
}</code>
github HHogg / remarkable-react / demo / CodeHighlighted.js View on Github external
render() {
    const { children, params, options } = this.props;
    let fences
    let className;
    let content = utils.escapeHtml(children);

    if (params) {
      fences = params.split(/\s+/g);
      className = `hljs ${options.langPrefix}${utils.escapeHtml(
        utils.replaceEntities(utils.unescapeMd(fences.join(' ')))
      )}`;

      if (options.highlight) {
        content = options.highlight.apply(
          options.highlight, [content].concat(fences)) || content;
      }
    }

    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

77 / 100
Full package analysis