soumaeda 2 лет назад
Родитель
Сommit
98f880ffcc

+ 7 - 6
packages/editor/src/services/codemirror-editor/use-codemirror-editor/use-codemirror-editor.ts

@@ -17,12 +17,12 @@ import { useInitDoc, type InitDoc } from './utils/init-doc';
 import { useSetCaretLine, type SetCaretLine } from './utils/set-caret-line';
 
 const markdownHighlighting = HighlightStyle.define([
-  { tag: tags.heading1 },
-  { tag: tags.heading2 },
-  { tag: tags.heading3 },
-  { tag: tags.heading4 },
-  { tag: tags.heading5 },
-  { tag: tags.heading6 },
+  { tag: tags.heading1, fontSize: '1.6em', fontWeight: 'bold' },
+  { tag: tags.heading2, fontSize: '1.4em', fontWeight: 'bold' },
+  { tag: tags.heading3, fontSize: '1.2em', fontWeight: 'bold' },
+  { tag: tags.heading4, fontSize: '1em', fontWeight: 'bold' },
+  { tag: tags.heading5, fontSize: '0.8em', fontWeight: 'bold' },
+  { tag: tags.heading6, fontSize: '0.6em', fontWeight: 'bold' },
 ]);
 
 type UseCodeMirrorEditorUtils = {
@@ -42,6 +42,7 @@ const defaultExtensions: Extension[] = [
   markdown({ base: markdownLanguage, codeLanguages: languages }),
   keymap.of([indentWithTab]),
   Prec.lowest(keymap.of(defaultKeymap)),
+  syntaxHighlighting(markdownHighlighting),
 ];
 
 export const useCodeMirrorEditor = (props?: UseCodeMirror): UseCodeMirrorEditor => {