soumaeda 2 лет назад
Родитель
Сommit
48abb29253

+ 20 - 0
packages/editor/src/components/CodeMirrorEditor/CodeMirrorEditor.module.scss

@@ -3,6 +3,26 @@
   .cm-editor {
     width: 100%;
     height: 100%;
+
+    .cm-header-1 {
+      font-size: 1.9em;
+    }
+    .cm-header-2 {
+      font-size: 1.6em;
+    }
+    .cm-header-3 {
+      font-size: 1.4em;
+    }
+    .cm-header-4 {
+      font-size: 1.35em;
+    }
+    .cm-header-5 {
+      font-size: 1.25em;
+    }
+    .cm-header-6 {
+      font-size: 1.2em;
+    }
+
   }
 
 }

+ 6 - 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, fontSize: '1.9em', fontWeight: 'bold' },
-  { tag: tags.heading2, fontSize: '1.6em', fontWeight: 'bold' },
-  { tag: tags.heading3, fontSize: '1.4em', fontWeight: 'bold' },
-  { tag: tags.heading4, fontSize: '1.35em', fontWeight: 'bold' },
-  { tag: tags.heading5, fontSize: '1.25em', fontWeight: 'bold' },
-  { tag: tags.heading6, fontSize: '1.2em', fontWeight: 'bold' },
+  { tag: tags.heading1, class: 'cm-header-1' },
+  { tag: tags.heading2, class: 'cm-header-2' },
+  { tag: tags.heading3, class: 'cm-header-3' },
+  { tag: tags.heading4, class: 'cm-header-4' },
+  { tag: tags.heading5, class: 'cm-header-5' },
+  { tag: tags.heading6, class: 'cm-header-6' },
 ]);
 
 type UseCodeMirrorEditorUtils = {