|
@@ -537,9 +537,9 @@
|
|
v-html="
|
|
v-html="
|
|
chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
|
|
chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
|
|
.taskDetail
|
|
.taskDetail
|
|
- ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
|
|
|
|
|
|
+ ? chapInfoList[courseType].chapterInfo[0].taskJson[
|
|
taskCount
|
|
taskCount
|
|
- ].taskDetail)
|
|
|
|
|
|
+ ].taskDetail
|
|
: '暂无描述'
|
|
: '暂无描述'
|
|
"
|
|
"
|
|
></div>
|
|
></div>
|
|
@@ -1551,7 +1551,7 @@
|
|
<!-- <div class="toolTitle">工具描述</div> -->
|
|
<!-- <div class="toolTitle">工具描述</div> -->
|
|
<!-- @click.stop="updateToolDetail(toolIndex, 2)" 点击开启修改-->
|
|
<!-- @click.stop="updateToolDetail(toolIndex, 2)" 点击开启修改-->
|
|
<div style="height:100%;"
|
|
<div style="height:100%;"
|
|
- v-html="renderedFormula(tool.toolDetail)"
|
|
|
|
|
|
+ v-html="tool.toolDetail"
|
|
v-if="toolDetailIndex != toolIndex"
|
|
v-if="toolDetailIndex != toolIndex"
|
|
></div>
|
|
></div>
|
|
<div v-else @click.stop="" style="height:100%;">
|
|
<div v-else @click.stop="" style="height:100%;">
|
|
@@ -4465,7 +4465,7 @@
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
"
|
|
"
|
|
>
|
|
>
|
|
- {{ index + 1 + "、" }} <span v-html="renderedFormula(item.teststitle)"></span>
|
|
|
|
|
|
+ {{ index + 1 + "、" }} <span v-html="item.teststitle"></span>
|
|
</div>
|
|
</div>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
@@ -9667,7 +9667,7 @@
|
|
>
|
|
>
|
|
(多选题)
|
|
(多选题)
|
|
</div>
|
|
</div>
|
|
- <div>题目:<span v-html="renderedFormula(testJson.testJson[index1].teststitle)"></span></div>
|
|
|
|
|
|
+ <div>题目:<span v-html="testJson.testJson[index1].teststitle"></span></div>
|
|
</div>
|
|
</div>
|
|
<img
|
|
<img
|
|
v-if="testJson.testJson[index1].img"
|
|
v-if="testJson.testJson[index1].img"
|
|
@@ -21554,51 +21554,6 @@ export default {
|
|
this.updateSplitScreenData(1);
|
|
this.updateSplitScreenData(1);
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- renderedFormula() {
|
|
|
|
- return function(val){
|
|
|
|
- try {
|
|
|
|
- // 判断是否含有HTML标签,<tag ...>...</tag>
|
|
|
|
- const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(val);
|
|
|
|
- if (!hasTag) {
|
|
|
|
- val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
|
|
|
|
- // 纯文本,整体渲染
|
|
|
|
- try {
|
|
|
|
- return katex.renderToString(val.trim(), {
|
|
|
|
- throwOnError: false,
|
|
|
|
- strict: false,
|
|
|
|
- output: "htmlAndMathml"
|
|
|
|
- });
|
|
|
|
- } catch (e) {
|
|
|
|
- return val; // 渲染失败原样输出
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- // 有标签,对每个标签内容渲染
|
|
|
|
- return val.replace(
|
|
|
|
- /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
|
|
|
|
- (match, tag, attrs, inner) => {
|
|
|
|
- let html;
|
|
|
|
- val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, '');
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- html = katex.renderToString(inner.trim(), {
|
|
|
|
- throwOnError: false,
|
|
|
|
- strict: false,
|
|
|
|
- output: "htmlAndMathml"
|
|
|
|
- });
|
|
|
|
- } catch (e) {
|
|
|
|
- html = inner;
|
|
|
|
- }
|
|
|
|
- return `<${tag}${attrs}>${html}</${tag}>`;
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- } catch (e) {
|
|
|
|
- console.error('KaTeX渲染错误:', e);
|
|
|
|
- return val;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
isAndroid() {
|
|
isAndroid() {
|
|
return /Android/i.test(navigator.userAgent);
|
|
return /Android/i.test(navigator.userAgent);
|
|
},
|
|
},
|