How to use the refractor/core.js.registered function in refractor

To help you get started, we’ve selected a few refractor 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 patternplate / patternplate / components / next-generation / code / src / code.tsx View on Github external
function highlight(language, source) {
  const lang = ALIASES[language] || language;

  if (!refractor.registered(lang)) {
    return source;
  }

  return refractor.highlight(source, lang);
}

refractor

Lightweight, robust, elegant virtual syntax highlighting using Prism

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis