From bb09a0f8e01dc91950d63fb4b7d80883ec2501ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 24 Feb 2020 11:47:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/busyWork/CommonWorkAppraise.js | 9 +-------- .../modules/courses/common/comments/CCommentItem.js | 11 ++--------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js index fdd0de05a..60194c744 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js @@ -45,13 +45,6 @@ class CommonWorkAppraise extends Component{ } exportMdtoHtml=(md)=> { let newmd=md; - newmd=newmd.replace(/TOC/g, ''); - newmd=newmd.replace(/\[|]/g,''); - newmd=newmd.replace(/`/g, ''); - newmd=newmd.replace(/`/g, ''); - newmd=newmd.replace(/"/g, ''); - newmd=newmd.replace(/"/g, ''); - newmd=newmd.replace(/"/g, ''); const converter = new showdown.Converter({ extensions: [ showdownKatex({ @@ -182,7 +175,7 @@ class CommonWorkAppraise extends Component{
内容
-
+
{attachments.map((item,key)=>{ diff --git a/public/react/src/modules/courses/common/comments/CCommentItem.js b/public/react/src/modules/courses/common/comments/CCommentItem.js index 4a399b11f..486a4d8f3 100644 --- a/public/react/src/modules/courses/common/comments/CCommentItem.js +++ b/public/react/src/modules/courses/common/comments/CCommentItem.js @@ -160,13 +160,6 @@ class CCommentItem extends Component{ exportMdtoHtml=(md)=> { let newmd=md; - newmd=newmd.replace(/TOC/g, ''); - newmd=newmd.replace(/\[|]/g,''); - newmd=newmd.replace(/`/g, ''); - newmd=newmd.replace(/`/g, ''); - newmd=newmd.replace(/"/g, ''); - newmd=newmd.replace(/"/g, ''); - newmd=newmd.replace(/"/g, ''); const converter = new showdown.Converter({ extensions: [ showdownKatex({ @@ -269,7 +262,7 @@ class CCommentItem extends Component{
+ dangerouslySetInnerHTML={{__html:markdownToHTML(item.content)}}>
@@ -285,7 +278,7 @@ class CCommentItem extends Component{ render(){ let { item, commentIndex, homework_status, is_author }=this.props; let { show_reply, show_appeal }=this.state; - const _content = item.content ? this.exportMdtoHtml(item.content) : '' + const _content = item.content ? markdownToHTML(item.content): '' const isAnonymous = homework_status && homework_status.indexOf('匿评中') != -1 const isAppealing = homework_status && homework_status.indexOf('申诉中') != -1 const attachments = item.attachments;