mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-25 00:00:00 +08:00
Updated the markdown editor to use codemirror as editor
Improved scroll sync system to be smarter
This commit is contained in:
@ -37,3 +37,20 @@ module.exports.highlight = function() {
|
||||
|
||||
};
|
||||
|
||||
module.exports.markdownEditor = function(elem) {
|
||||
let content = elem.textContent;
|
||||
|
||||
let cm = CodeMirror(function(elt) {
|
||||
elem.parentNode.insertBefore(elt, elem);
|
||||
elem.style.display = 'none';
|
||||
}, {
|
||||
value: content,
|
||||
mode: "markdown",
|
||||
lineNumbers: true,
|
||||
theme: 'base16-light',
|
||||
lineWrapping: true
|
||||
});
|
||||
return cm;
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user