How to use the prismjs.languages.javascript 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 sagalbot / vue-select / docs / .vuepress / components / ApiDocs.vue View on Github external
    highlight: snippet => highlight(snippet, languages.javascript, 'javascript'),
    /**
github se-panfilov / jsvat / src / app / common-playground / common-playground.component.ts View on Github external
updateExampleValue(vat: string | undefined, countries: ReadonlyArray): void {
    const code = checkVAT(vat, countries)
    const codeStr = JSON.stringify(code, null, 2).replace(/"(\S+)":/g, '$1:')
    if (code) this.code = highlight(codeStr, languages.javascript, 'javascript')
  }
github soska / keyboardist / src / docs / index.js View on Github external
counterUpdate();
};

const counterUpdate = () => (input.value = val);

counterUpdate();

inputListener.subscribe('Down', counterDown);
inputListener.subscribe('Up', counterUp);
inputListener.subscribe('Escape', counterReset);


`;

const codeWrapper = document.getElementById('code');
const html = highlight(code, languages.javascript, 'javascript');
codeWrapper.innerHTML = '<pre class="language-javascript">' + html + '</pre>';
github rubenspgcavalcante / leaflet-ant-path / app / modules / home / components / stateless / CodeSnippet.jsx View on Github external
const CodeSnippet = ({ id, options }) =&gt; (
  <div>
  <pre>      {snippets[id] ? renderHTML(highlight(snippets[id](options), languages.javascript)) : null};
  </pre>
  </div>
);