Updated the markdown editor to use codemirror as editor

Improved scroll sync system to be smarter
This commit is contained in:
Dan Brown
2017-05-28 16:02:46 +01:00
parent e5fc6bf5fa
commit 88f93f76dd
4 changed files with 70 additions and 39 deletions

View File

@ -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;
};