mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-19 02:10:04 +08:00
fix(code): apply syntax highlighting to preview
This commit is contained in:
parent
9875d4ba3c
commit
81a7133ab1
@ -12,7 +12,7 @@ interface Theme {
|
|||||||
|
|
||||||
type Response = Theme[];
|
type Response = Theme[];
|
||||||
|
|
||||||
const SAMPLE_MIME = "text/typescript";
|
const SAMPLE_MIME = "application/typescript";
|
||||||
const SAMPLE_CODE = `\
|
const SAMPLE_CODE = `\
|
||||||
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
|
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
|
||||||
import { EditorView, highlightActiveLine, keymap, lineNumbers, placeholder, ViewUpdate, type EditorViewConfig } from "@codemirror/view";
|
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],
|
parent: this.$sampleEl[0],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.editor.setMimeType(SAMPLE_MIME);
|
|
||||||
this.editor.setText(SAMPLE_CODE);
|
this.editor.setText(SAMPLE_CODE);
|
||||||
|
this.editor.setMimeType(SAMPLE_MIME);
|
||||||
|
|
||||||
// Load the theme.
|
// Load the theme.
|
||||||
const themeId = options.codeNoteTheme;
|
const themeId = options.codeNoteTheme;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user