mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-31 22:04:29 -06:00
Adding support for asciidoctor
A editor that can edit asciidoctor online ..... It seems the performance of the editor is not good.
This commit is contained in:
parent
5f3a67dae2
commit
b9f77e0bea
@ -9,6 +9,7 @@ require("codemirror/addon/mode/overlay.js");
|
|||||||
require("codemirror/mode/gfm/gfm.js");
|
require("codemirror/mode/gfm/gfm.js");
|
||||||
require("codemirror/mode/xml/xml.js");
|
require("codemirror/mode/xml/xml.js");
|
||||||
require("spell-checker");
|
require("spell-checker");
|
||||||
|
require("codemirror-asciidoc");
|
||||||
var marked = require("marked");
|
var marked = require("marked");
|
||||||
|
|
||||||
|
|
||||||
@ -371,6 +372,10 @@ function toggleSideBySide(editor) {
|
|||||||
// Updates preview
|
// Updates preview
|
||||||
cm.on("update", function() {
|
cm.on("update", function() {
|
||||||
preview.innerHTML = editor.options.previewRender(editor.value(), preview);
|
preview.innerHTML = editor.options.previewRender(editor.value(), preview);
|
||||||
|
//post preview render callback let customer programming such as fire highlight script.
|
||||||
|
if(editor.options.afterPreviewRender) {
|
||||||
|
editor.options.afterPreviewRender(preview, editor);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1037,9 +1042,7 @@ SimpleMDE.prototype.render = function(el) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.codemirror = CodeMirror.fromTextArea(el, {
|
this.codemirror = CodeMirror.fromTextArea(el, {
|
||||||
mode: mode,
|
mode: "asciidoc",
|
||||||
backdrop: backdrop,
|
|
||||||
theme: "paper",
|
|
||||||
tabSize: (options.tabSize != undefined) ? options.tabSize : 2,
|
tabSize: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
indentUnit: (options.tabSize != undefined) ? options.tabSize : 2,
|
indentUnit: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
indentWithTabs: (options.indentWithTabs === false) ? false : true,
|
indentWithTabs: (options.indentWithTabs === false) ? false : true,
|
||||||
@ -1050,6 +1053,20 @@ SimpleMDE.prototype.render = function(el) {
|
|||||||
allowDropFileTypes: ["text/plain"]
|
allowDropFileTypes: ["text/plain"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* this.codemirror = CodeMirror.fromTextArea(el, {
|
||||||
|
mode: mode,
|
||||||
|
backdrop: backdrop,
|
||||||
|
theme: "paper",
|
||||||
|
tabSize: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
|
indentUnit: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
|
indentWithTabs: (options.indentWithTabs === false) ? false : true,
|
||||||
|
lineNumbers: false,
|
||||||
|
autofocus: (options.autofocus === true) ? true : false,
|
||||||
|
extraKeys: keyMaps,
|
||||||
|
lineWrapping: (options.lineWrapping === false) ? false : true,
|
||||||
|
allowDropFileTypes: ["text/plain"]
|
||||||
|
});*/
|
||||||
|
|
||||||
if(options.toolbar !== false) {
|
if(options.toolbar !== false) {
|
||||||
this.createToolbar();
|
this.createToolbar();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user