|
|
@ -995,7 +995,7 @@ function toggleSideBySide(editor) {
|
|
|
|
var sideBySideRenderingFunction = function () {
|
|
|
|
var sideBySideRenderingFunction = function () {
|
|
|
|
var newValue = editor.options.previewRender(editor.value(), preview);
|
|
|
|
var newValue = editor.options.previewRender(editor.value(), preview);
|
|
|
|
if (newValue != null) {
|
|
|
|
if (newValue != null) {
|
|
|
|
preview.innerHTML = newValue;
|
|
|
|
editor.options.setPreviewRender(preview, newValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -1006,7 +1006,7 @@ function toggleSideBySide(editor) {
|
|
|
|
if (useSideBySideListener) {
|
|
|
|
if (useSideBySideListener) {
|
|
|
|
var newValue = editor.options.previewRender(editor.value(), preview);
|
|
|
|
var newValue = editor.options.previewRender(editor.value(), preview);
|
|
|
|
if (newValue != null) {
|
|
|
|
if (newValue != null) {
|
|
|
|
preview.innerHTML = newValue;
|
|
|
|
editor.options.setPreviewRender(preview, newValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cm.on('update', cm.sideBySideRenderingFunction);
|
|
|
|
cm.on('update', cm.sideBySideRenderingFunction);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1072,8 +1072,7 @@ function togglePreview(editor) {
|
|
|
|
toolbar_div.classList.add('disabled-for-preview');
|
|
|
|
toolbar_div.classList.add('disabled-for-preview');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
preview.innerHTML = editor.options.previewRender(editor.value(), preview);
|
|
|
|
editor.options.setPreviewRender(preview, editor.options.previewRender(editor.value(), preview));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function _replaceSelection(cm, active, startEnd, url) {
|
|
|
|
function _replaceSelection(cm, active, startEnd, url) {
|
|
|
@ -1830,6 +1829,12 @@ function EasyMDE(options) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!options.setPreviewRender) {
|
|
|
|
|
|
|
|
options.setPreviewRender = function (preview, html) {
|
|
|
|
|
|
|
|
preview.innerHTML = html;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set default options for parsing config
|
|
|
|
// Set default options for parsing config
|
|
|
|
options.parsingConfig = extend({
|
|
|
|
options.parsingConfig = extend({
|
|
|
@ -2878,7 +2883,7 @@ EasyMDE.prototype.value = function (val) {
|
|
|
|
if (this.isPreviewActive()) {
|
|
|
|
if (this.isPreviewActive()) {
|
|
|
|
var wrapper = cm.getWrapperElement();
|
|
|
|
var wrapper = cm.getWrapperElement();
|
|
|
|
var preview = wrapper.lastChild;
|
|
|
|
var preview = wrapper.lastChild;
|
|
|
|
preview.innerHTML = this.options.previewRender(val, preview);
|
|
|
|
this.options.setPreviewRender(preview, this.options.previewRender(val, preview));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|