From 4d783f1879160b34e564d7da01294424b00b8100 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 31 Oct 2024 21:45:06 +0200 Subject: [PATCH] client: Fix color theme leak when deactivating highlighting --- src/public/app/services/library_loader.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/public/app/services/library_loader.js b/src/public/app/services/library_loader.js index a6b770038..f5299ae33 100644 --- a/src/public/app/services/library_loader.js +++ b/src/public/app/services/library_loader.js @@ -158,7 +158,16 @@ async function requireCss(url, prependAssetPath = true) { let highlightingThemeEl = null; function loadHighlightingTheme(theme) { - if (!theme) { + if (!theme) { + return; + } + + if (theme === "none") { + // Deactivate the theme. + if (highlightingThemeEl) { + highlightingThemeEl.remove(); + highlightingThemeEl = null; + } return; }