mirror of
https://github.com/zadam/trilium.git
synced 2026-03-22 00:03:41 +01:00
feat(editor): make theme selector scoped to code tag regex more robust
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
603b47f9b0
commit
50e5f89e9a
@ -48,7 +48,7 @@ export function highlight(code: string, options: HighlightOptions) {
|
||||
}
|
||||
|
||||
export function normalizeThemeCss(themeCss: string): string {
|
||||
const themeSelectorScopedToCodeTag = /\bcode \.hljs-/.test(themeCss);
|
||||
const themeSelectorScopedToCodeTag = /\bcode\s+\.hljs-/.test(themeCss);
|
||||
if (themeSelectorScopedToCodeTag) {
|
||||
themeCss = themeCss.replace(/\bcode\.hljs/g, ".hljs");
|
||||
themeCss = themeCss.replace(/\bcode \.hljs-/g, ".hljs .hljs-");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user