1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

CM6: Got WYSIWYG code blocks working

Required monkey-patch to work around potential codemirror issue with
shadowdom+iframe usage.
Also updated JS packages to latest versions.
This commit is contained in:
Dan Brown
2023-04-16 23:48:45 +01:00
parent 74b4751a1c
commit 09fd0bc5b7
5 changed files with 228 additions and 210 deletions

View File

@ -110,8 +110,7 @@ function defineCodeBlockCustomElement(editor) {
const container = this.shadowRoot.querySelector('.CodeMirrorContainer');
const renderCodeMirror = (Code) => {
this.cm = Code.wysiwygView(container, content, this.getLanguage());
setTimeout(() => Code.updateLayout(this.cm), 10);
this.cm = Code.wysiwygView(container, this.shadowRoot, content, this.getLanguage());
setTimeout(() => this.style.height = null, 12);
};