From 7e60526661a224b0ae83170f2b8195b6fdc578b6 Mon Sep 17 00:00:00 2001 From: RanolP Date: Mon, 26 Aug 2024 00:48:21 +0900 Subject: [PATCH] fix highlight for code editor --- index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 466e0f7..7174939 100644 --- a/index.html +++ b/index.html @@ -431,7 +431,10 @@ }; const $elements = document.getElementById('elements'); const updateStyle = (isDark) => { - for (const pre of $elements.querySelectorAll('pre.sl-code-viewer')) { + for (const pre of [ + ...Array.from($elements.querySelectorAll('pre.sl-code-viewer')), + ...Array.from($elements.querySelectorAll('div.sl-code-editor')), + ]) { const isPreDark = isDark || !!pre.closest('.sl-inverted'); const theme = isPreDark ? darkTheme : lightTheme; for (const span of pre.querySelectorAll('span')) {