From d4957c8c9c436c7d8432970617f0f897023e87d0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 9 May 2020 11:54:17 +0800 Subject: [PATCH] =?UTF-8?q?md=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/editormd/editormd.min.js | 22 +++++++++---------- src/App.js | 4 ++-- .../tpm/challengesnew/tpm-md-editor.js | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) 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) } })