From 625f82880faea02b80eb2b5bbe60bd44564685eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Wed, 6 Nov 2024 11:24:53 +0800 Subject: [PATCH] 1 --- src/renderer/src/views/tool/createHomework.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/renderer/src/views/tool/createHomework.js b/src/renderer/src/views/tool/createHomework.js index dc1a8cf..5f3cc75 100644 --- a/src/renderer/src/views/tool/createHomework.js +++ b/src/renderer/src/views/tool/createHomework.js @@ -43,6 +43,16 @@ export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) => { let classWorkList = [] +// 将标签中的双引号增加转义 +const escapeHtmlQuotes = (str) => { + // 后端已replace双引号, 故前端不用在处理 + const regex1 = /\\+/g; // 匹配多个反斜杠 + let result = str.replace(regex1, '\\'); + result = str.replace(/(?'); //替换\n而不替换\\n 为 \\n + + return result; +} + /** * 获取班级作业 */