Skip to content

Commit 7e60526

Browse files
committed
fix highlight for code editor
1 parent f54be3e commit 7e60526

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,10 @@
431431
};
432432
const $elements = document.getElementById('elements');
433433
const updateStyle = (isDark) => {
434-
for (const pre of $elements.querySelectorAll('pre.sl-code-viewer')) {
434+
for (const pre of [
435+
...Array.from($elements.querySelectorAll('pre.sl-code-viewer')),
436+
...Array.from($elements.querySelectorAll('div.sl-code-editor')),
437+
]) {
435438
const isPreDark = isDark || !!pre.closest('.sl-inverted');
436439
const theme = isPreDark ? darkTheme : lightTheme;
437440
for (const span of pre.querySelectorAll('span')) {

0 commit comments

Comments
 (0)