How to use the react-syntax-highlighter/dist/cjs/prism.Prism.registerLanguage function in react-syntax-highlighter

To help you get started, we’ve selected a few react-syntax-highlighter 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 jxnblk / mdx-deck / src / HighlightCode.js View on Github external
constructor(props) {
    super(props)
    Prism.registerLanguage('javascript', javascript)
    Prism.registerLanguage('jsx', jsx)
    if (props.theme && props.theme.prism && props.theme.prism.languages) {
      const languages = props.theme.prism.languages
      Object.keys(languages).forEach(key => {
        Prism.registerLanguage(key, languages[key])
      })
    }
  }
github jxnblk / mdx-deck / src / HighlightCode.js View on Github external
Object.keys(languages).forEach(key => {
        Prism.registerLanguage(key, languages[key])
      })
    }
github jxnblk / mdx-deck / src / HighlightCode.js View on Github external
constructor(props) {
    super(props)
    Prism.registerLanguage('javascript', javascript)
    Prism.registerLanguage('jsx', jsx)
    if (props.theme && props.theme.prism && props.theme.prism.languages) {
      const languages = props.theme.prism.languages
      Object.keys(languages).forEach(key => {
        Prism.registerLanguage(key, languages[key])
      })
    }
  }