Skip to content

Commit

Permalink
fix highlight for code editor
Browse files Browse the repository at this point in the history
  • Loading branch information
RanolP committed Aug 25, 2024
1 parent f54be3e commit 7e60526
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 7e60526

Please sign in to comment.