mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
CM6: Added tabbing, fixed dark mode border in WYSIWYG
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import {EditorView, keymap, drawSelection, highlightActiveLine, dropCursor,
|
||||
rectangularSelection, lineNumbers, highlightActiveLineGutter} from "@codemirror/view"
|
||||
import {bracketMatching} from "@codemirror/language"
|
||||
import {defaultKeymap, history, historyKeymap} from "@codemirror/commands"
|
||||
import {defaultKeymap, history, historyKeymap, indentWithTab} from "@codemirror/commands"
|
||||
import {EditorState} from "@codemirror/state"
|
||||
import {getTheme} from "./themes";
|
||||
|
||||
@ -47,6 +47,7 @@ export function editorExtensions(parentEl) {
|
||||
keymap.of([
|
||||
...defaultKeymap,
|
||||
...historyKeymap,
|
||||
indentWithTab,
|
||||
]),
|
||||
EditorView.lineWrapping,
|
||||
];
|
||||
|
@ -53,6 +53,7 @@ function defineCodeBlockCustomElement(editor) {
|
||||
cmContainer.style.pointerEvents = 'none';
|
||||
cmContainer.contentEditable = 'false';
|
||||
cmContainer.classList.add('CodeMirrorContainer');
|
||||
cmContainer.classList.toggle('dark-mode', document.documentElement.classList.contains('dark-mode'));
|
||||
|
||||
this.shadowRoot.append(...copiedStyles, cmContainer);
|
||||
}
|
||||
|
Reference in New Issue
Block a user