How to use the prismjs/components/prism-core.highlight function in prismjs

To help you get started, we’ve selected a few prismjs 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 react-theming / create-mui-theme / src / ui / Editor / Editor.js View on Github external
        highlight={code => highlight(code, languages.js)}
        // padding={10}
github bootstrap-styled / rsg-components / src / Editor / Editor.js View on Github external
const highlight = (code) => Prism.highlight(code, Prism.languages.jsx, 'jsx');
github expo / snack-web / src / client / components / Editor / SimpleEditor.tsx View on Github external
_highlight = (code: string) => {
    if (this.props.path.endsWith('.ts') || this.props.path.endsWith('.tsx')) {
      return highlight(code, languages.ts);
    } else if (this.props.path.endsWith('.js')) {
      return highlight(code, languages.jsx);
    } else if (this.props.path.endsWith('.json')) {
      return highlight(code, languages.json);
    } else if (this.props.path.endsWith('.md')) {
      return highlight(code, languages.markdown);
    }

    return escape(code);
  };
github expo / snack-web / snack / components / Editor / SimpleEditor.js View on Github external
_highlight = code => {
    if (this.props.path.endsWith('.js')) {
      return highlight(code, languages.jsx);
    } else if (this.props.path.endsWith('.json')) {
      return highlight(code, languages.json);
    } else if (this.props.path.endsWith('.md')) {
      return highlight(code, languages.markdown);
    }

    return escape(code);
  };
github jquense / react-widgets / www / plugins / gatsby-plugin-jsxtreme-markdown / prism.js View on Github external
module.exports = (code, language = 'jsx') =>
  highlight(code, languages[language] || languages.text)
github Fndroid / clash-config-builder / src / components / inputDrawer.js View on Github external
                highlight={code => isHieghtlight ? highlight(code, languages.yaml, 'yaml') : code}
                padding={10}
github higlass / higlass / app / scripts / ViewConfigEditor.js View on Github external
            highlight={code => highlight(code, languages.json)}
            onValueChange={this.handleChangeBound}
github FormidableLabs / react-live / src / utils / prism.js View on Github external
const prism = (code, language = 'jsx') => highlight(code, languages[language])