diff --git a/public/js/editormd/editormd.min.js b/public/js/editormd/editormd.min.js old mode 100755 new mode 100644 index 0add3b370..844dd546c --- a/public/js/editormd/editormd.min.js +++ b/public/js/editormd/editormd.min.js @@ -558,20 +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 () { + if (settings.previewCodeHighlight) { + editormd.loadScript(loadPath + "prettify.min", function () { + loadFlowChartOrSequenceDiagram(); + }); + } + else { loadFlowChartOrSequenceDiagram(); - }); - } - else { - loadFlowChartOrSequenceDiagram(); - } + } + }); }); @@ -831,7 +831,7 @@ if (scrollTop === 0) { preview.scrollTop(0); } - else if (scrollTop + height >= cmScroll.scrollHeight - 16) { + else if (scrollTop + height >= cmScroll.scrollHeight - 30) { preview.scrollTop(preview[0].scrollHeight); } else { @@ -1434,7 +1434,7 @@ var tex = $(this); editormd.$katex.render(tex.text(), tex[0]); - tex.find(".katex").css("font-size", "1.0em"); + tex.find(".katex").css("font-size", "1.6em"); }); return this; @@ -1471,7 +1471,6 @@ var preview = $this.preview; var codeMirror = $this.codeMirror; var codeView = codeMirror.find(".CodeMirror-scroll"); - var height = codeView.height(); var scrollTop = codeView.scrollTop(); var percent = (scrollTop / codeView[0].scrollHeight); @@ -1483,11 +1482,11 @@ var tocMenuHeight = preview.find(".editormd-toc-menu").height(); tocMenuHeight = (!tocMenuHeight) ? 0 : tocMenuHeight; - + if (scrollTop === 0) { preview.scrollTop(0); } - else if (scrollTop + height >= codeView[0].scrollHeight - 16) { + else if (scrollTop + height >= codeView[0].scrollHeight - 30) { preview.scrollTop(preview[0].scrollHeight); } else { @@ -1595,8 +1594,7 @@ codeMirror.find(".CodeMirror-scroll").bind(mouseOrTouch("scroll", "touchmove"), function (event) { var height = $(this).height(); var scrollTop = $(this).scrollTop(); - var percent = (scrollTop / $(this)[0].scrollHeight); - + var percent = (scrollTop / ($(this)[0].scrollHeight-100)); var tocHeight = 0; preview.find(".markdown-toc-list").each(function () { @@ -1609,7 +1607,7 @@ if (scrollTop === 0) { preview.scrollTop(0); } - else if (scrollTop + height >= $(this)[0].scrollHeight - 16) { + else if (scrollTop + height >= $(this)[0].scrollHeight - 30) { preview.scrollTop(preview[0].scrollHeight); } else { @@ -3319,9 +3317,9 @@ text = text.replace(emailReg, function ($1, $2, $3, $4) { return $1.replace(/@/g, "_#_@_#_"); }); - + // " + editormd.urls.atLinkBase + "" + $2 + " text = text.replace(atLinkReg, function ($1, $2) { - return "" + $1 + ""; + return " " + $1 + " "; }).replace(/_#_@_#_/g, "@"); } @@ -3810,7 +3808,7 @@ div.find("." + editormd.classNames.tex).each(function () { var tex = $(this); katex.render(tex.text(), tex[0]); - tex.find(".katex").css("font-size", "1.0em"); + tex.find(".katex").css("font-size", "1.6em"); }); }; diff --git a/src/modules/tpm/challengesnew/css/newquestion.css b/src/modules/tpm/challengesnew/css/newquestion.css index 444ca8d16..5c650e3d0 100644 --- a/src/modules/tpm/challengesnew/css/newquestion.css +++ b/src/modules/tpm/challengesnew/css/newquestion.css @@ -4,4 +4,7 @@ .Permanentban{ color:#5091FF !important; border-color: #5091FF !important; -} \ No newline at end of file +} +.editormd-menu>li:last-child { + float: right; +} diff --git a/src/modules/tpm/challengesnew/tpm-md-editor.js b/src/modules/tpm/challengesnew/tpm-md-editor.js index 6e00285cc..5d147a277 100644 --- a/src/modules/tpm/challengesnew/tpm-md-editor.js +++ b/src/modules/tpm/challengesnew/tpm-md-editor.js @@ -1,8 +1,6 @@ import React, { Fragment, useEffect, useRef, useState } from 'react'; import { getUploadActionUrl, getUrl } from 'educoder'; import ResizeObserver from 'resize-observer-polyfill'; -// import myxss from '../../../common/filterXss'; -import xss from 'xss'; import { getImageUrl } from 'educoder'; import axios from 'axios'; import '../../courses/css/Courses.css'; @@ -11,7 +9,7 @@ import 'codemirror/lib/codemirror.css'; import './css/newquestion.css'; const $ = window.$ -const mdIcons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear","fullscreen"]; +const mdIcons = ["bold", "italic", "del", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear","fullscreen"]; const NULL_CH = '▁'; @@ -122,7 +120,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla // 请求issues接口获取全部可quote的issue列表 function getIssueList(keyword){ axios.get(`/v1/${owner}/${projectsId}/issues`,{params:{ - only_name:true,keyword,sort_direction:"desc",sort_by:"issues.created_on" + only_name:true,keyword,sort_direction:"desc",sort_by:"issues.created_on",limit:500,page:1 }}).then(result=>{ if(result){ !keyword && setIssues(result.data.issues); @@ -319,7 +317,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla {users && users.map((item,key)=>{ return(