fix(text): code block background not correct

This commit is contained in:
Elian Doran
2025-12-06 09:15:37 +02:00
parent 831d1b4f3a
commit e6436f9021
4 changed files with 100 additions and 189 deletions

View File

@@ -61,7 +61,11 @@ export async function loadTheme(theme: "none" | Theme) {
document.querySelector("head")?.append(highlightingThemeEl);
}
const themeCss = (await theme.load()).default as string;
let themeCss = (await theme.load()).default as string;
// Increase the specificity of the HLJS selector to render properly within CKEditor without the need of patching the library.
themeCss = themeCss.replace(/^.hljs {/m, ".hljs, .ck-content pre.hljs {");
highlightingThemeEl.textContent = themeCss;
}