MCPcopy
hub / github.com/wooorm/starry-night / generate

Function generate

script/preview.js:60–66  ·  view source on GitHub ↗

* @param {string} value * Value to highlight. * @param {string} scope * Scope to highlight with.

(value, scope)

Source from the content-addressed store, hash-verified

58 * Scope to highlight with.
59 */
60function generate(value, scope) {
61 const className = scope.replace(/^source\./, '').replace(/\./g, '-')
62 return `<div class="highlight highlight-${className}"><pre>${toHtml(
63 highlighter.highlight(value, scope)
64 )}
65</pre></div>`
66}

Callers 1

preview.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected