]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/components/markdown-editor.js
Merge branch 'master' into fix/#960
[bookstack] / resources / assets / js / components / markdown-editor.js
index 9e2bb3915e4dc3a985b8a2e88da58cc7aa047847..a555376e8eaca5094620b3c3fe03a68824c8acca 100644 (file)
@@ -8,6 +8,7 @@ class MarkdownEditor {
 
     constructor(elem) {
         this.elem = elem;
+        this.textDirection = document.getElementById('page-editor').getAttribute('text-direction');
         this.markdown = new MarkdownIt({html: true});
         this.markdown.use(mdTasksLists, {label: true});
 
@@ -98,6 +99,9 @@ class MarkdownEditor {
 
     codeMirrorSetup() {
         let cm = this.cm;
+        // Text direction
+        // cm.setOption('direction', this.textDirection);
+        cm.setOption('direction', 'ltr'); // Will force to remain as ltr for now due to issues when HTML is in editor.
         // Custom key commands
         let metaKey = code.getMetaKey();
         const extraKeys = {};