diff --git a/public/js/editormd/editormd.min.js b/public/js/editormd/editormd.min.js index c60e4771..0add3b37 100755 --- a/public/js/editormd/editormd.min.js +++ b/public/js/editormd/editormd.min.js @@ -558,19 +558,20 @@ _this.setToolbar(); - editormd.loadScript(loadPath + "marked.min", function () { + // editormd.loadScript(loadPath + "marked.min", function () { + // }); - editormd.$marked = marked; + editormd.$marked = marked; - if (settings.previewCodeHighlight) { - editormd.loadScript(loadPath + "prettify.min", function () { - loadFlowChartOrSequenceDiagram(); - }); - } - else { + if (settings.previewCodeHighlight) { + editormd.loadScript(loadPath + "prettify.min", function () { loadFlowChartOrSequenceDiagram(); - } - }); + }); + } + else { + loadFlowChartOrSequenceDiagram(); + } + }); @@ -1429,7 +1430,6 @@ if (timer === null) { return this; } - this.previewContainer.find("." + editormd.classNames.tex).each(function () { var tex = $(this); editormd.$katex.render(tex.text(), tex[0]); diff --git a/src/App.js b/src/App.js index 7c715b50..e958782c 100644 --- a/src/App.js +++ b/src/App.js @@ -20,7 +20,7 @@ import Certifiedprofessional from './modules/modals/Certifiedprofessional'; import Loading from './Loading' import Loadable from 'react-loadable'; - +import marked from './common/marked' import moment from 'moment' @@ -33,7 +33,7 @@ import { initAxiosInterceptors } from './AppConfig' import { Provider } from 'react-redux'; import configureStore from './redux/stores/configureStore'; const store = configureStore(); - +window.marked = marked; const theme = createMuiTheme({ palette: { primary: { diff --git a/src/modules/tpm/challengesnew/tpm-md-editor.js b/src/modules/tpm/challengesnew/tpm-md-editor.js index 0d720b8e..0fa0e1fd 100644 --- a/src/modules/tpm/challengesnew/tpm-md-editor.js +++ b/src/modules/tpm/challengesnew/tpm-md-editor.js @@ -168,7 +168,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla } }, onload: function () { - setEditorInstance(editor_instance) + setEditorInstance(this) } })