MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / initHighlighting

Function initHighlighting

src/utils/codeHighlight.js:305–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

303 * Injects theme-based CSS and sets up listener for theme changes.
304 */
305export function initHighlighting() {
306 injectStyles();
307
308 settings.on("update:editorTheme:after", () => {
309 const newThemeId = settings?.value?.editorTheme || "one_dark";
310 if (newThemeId !== currentThemeId) {
311 injectStyles();
312 highlightCache.clear();
313 }
314 });
315}
316
317export default {
318 sanitize,

Callers 3

onDeviceReadyFunction · 0.90
renderFunction · 0.90
createMarkdownPreviewFunction · 0.90

Calls 3

injectStylesFunction · 0.85
onMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected