From 81a7133ab10c8ba814c8bdfc558c3b193013858d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 11 May 2025 23:10:01 +0300 Subject: [PATCH] fix(code): apply syntax highlighting to preview --- .../src/widgets/type_widgets/options/code_notes/code_theme.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts b/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts index 808c58255..6d61ed2e4 100644 --- a/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts +++ b/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts @@ -12,7 +12,7 @@ interface Theme { type Response = Theme[]; -const SAMPLE_MIME = "text/typescript"; +const SAMPLE_MIME = "application/typescript"; const SAMPLE_CODE = `\ import { defaultKeymap, history, historyKeymap } from "@codemirror/commands"; import { EditorView, highlightActiveLine, keymap, lineNumbers, placeholder, ViewUpdate, type EditorViewConfig } from "@codemirror/view"; @@ -127,8 +127,8 @@ export default class CodeTheme extends OptionsWidget { parent: this.$sampleEl[0], }); } - this.editor.setMimeType(SAMPLE_MIME); this.editor.setText(SAMPLE_CODE); + this.editor.setMimeType(SAMPLE_MIME); // Load the theme. const themeId = options.codeNoteTheme;