()
| 303 | * Injects theme-based CSS and sets up listener for theme changes. |
| 304 | */ |
| 305 | export 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 | |
| 317 | export default { |
| 318 | sanitize, |
no test coverage detected