MCPcopy
hub / github.com/jamiebuilds/spectacle-code-slide / highlightCode

Function highlightCode

src/getHighlightedCodeLines.js:3–9  ·  view source on GitHub ↗
(code, lang)

Source from the content-addressed store, hash-verified

1const memoize = require('lodash.memoize');
2
3function highlightCode(code, lang) {
4 if (window.Prism) {
5 return window.Prism.highlight(code, window.Prism.languages[lang])
6 } else {
7 return code;
8 }
9}
10
11function getHighlightedCodeLines(code, lang) {
12 return highlightCode(code, lang).split('\n');

Callers 1

getHighlightedCodeLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected