This commit is contained in:
白了个白 2024-11-06 11:24:53 +08:00
parent 3b2fee6731
commit 625f82880f
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,16 @@ export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) => {
let classWorkList = [] let classWorkList = []
// 将标签中的双引号增加转义
const escapeHtmlQuotes = (str) => {
// 后端已replace双引号, 故前端不用在处理
const regex1 = /\\+/g; // 匹配多个反斜杠
let result = str.replace(regex1, '\\');
result = str.replace(/(?<!\\)\n/g, '<br />'); //替换\n而不替换\\n 为 \\n
return result;
}
/** /**
* 获取班级作业 * 获取班级作业
*/ */