Merge pull request #97 from getselfstudy/master

Allow html to stay on preview page to make it easier to use with react.
pull/115/head
Jeroen Akkerman 5 years ago committed by GitHub
commit 8fa457e5c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upload images functionality (Thanks to [@roipoussiere] and [@JeroenvO], [#71], [#101]). - Upload images functionality (Thanks to [@roipoussiere] and [@JeroenvO], [#71], [#101]).
- Allow custom image upload function (Thanks to [@sperezp], [#106]). - Allow custom image upload function (Thanks to [@sperezp], [#106]).
- More polish to the upload images functionality (Thanks to [@jfly], [#109]). - More polish to the upload images functionality (Thanks to [@jfly], [#109]).
- Improved React compatibility (Thanks to [@richtera], [#97]).
## [2.7.0] - 2019-07-13 ## [2.7.0] - 2019-07-13
### Added ### Added
@ -129,6 +130,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
[#109]: https://github.com/Ionaru/easy-markdown-editor/pull/109 [#109]: https://github.com/Ionaru/easy-markdown-editor/pull/109
[#106]: https://github.com/Ionaru/easy-markdown-editor/pull/106 [#106]: https://github.com/Ionaru/easy-markdown-editor/pull/106
[#101]: https://github.com/Ionaru/easy-markdown-editor/pull/101 [#101]: https://github.com/Ionaru/easy-markdown-editor/pull/101
[#97]: https://github.com/Ionaru/easy-markdown-editor/pull/97
[#93]: https://github.com/Ionaru/easy-markdown-editor/pull/93 [#93]: https://github.com/Ionaru/easy-markdown-editor/pull/93
[#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75 [#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75
[#71]: https://github.com/Ionaru/easy-markdown-editor/pull/71 [#71]: https://github.com/Ionaru/easy-markdown-editor/pull/71
@ -138,6 +140,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
[#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19 [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19
<!-- Linked users --> <!-- Linked users -->
[@richtera]: https://github.com/richtera
[@jfly]: https://github.com/jfly [@jfly]: https://github.com/jfly
[@sperezp]: https://github.com/sperezp [@sperezp]: https://github.com/sperezp
[@JeroenvO]: https://github.com/JeroenvO [@JeroenvO]: https://github.com/JeroenvO

@ -817,7 +817,10 @@ function toggleSideBySide(editor) {
} }
var sideBySideRenderingFunction = function () { var sideBySideRenderingFunction = function () {
preview.innerHTML = editor.options.previewRender(editor.value(), preview); var newValue = editor.options.previewRender(editor.value(), preview);
if (newValue != null) {
preview.innerHTML = newValue;
}
}; };
if (!cm.sideBySideRenderingFunction) { if (!cm.sideBySideRenderingFunction) {
@ -825,7 +828,10 @@ function toggleSideBySide(editor) {
} }
if (useSideBySideListener) { if (useSideBySideListener) {
preview.innerHTML = editor.options.previewRender(editor.value(), preview); var newValue = editor.options.previewRender(editor.value(), preview);
if (newValue != null) {
preview.innerHTML = newValue;
}
cm.on('update', cm.sideBySideRenderingFunction); cm.on('update', cm.sideBySideRenderingFunction);
} else { } else {
cm.off('update', cm.sideBySideRenderingFunction); cm.off('update', cm.sideBySideRenderingFunction);

Loading…
Cancel
Save