浏览代码

Merge branch 'beta'

SanHQin 1 月之前
父节点
当前提交
e6f2d52113

+ 1 - 1
dist/index.html

@@ -27,7 +27,7 @@
     html,
     body{
       font-family: '黑体';
-    }</style><link href=./static/css/app.5f719fe5e2e4d76f7c0a70befd954e9f.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.acc9cff1d5ed8d2b9ae3.js></script><script type=text/javascript src=./static/js/app.3b94b9dfb3b2512fea9f.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.00b5e5de0884ec27761b8ba1425aa12c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.b2299056e030e9dd4cb8.js></script><script type=text/javascript src=./static/js/app.5e46eaca16c640c0bbf5.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.00b5e5de0884ec27761b8ba1425aa12c.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.00b5e5de0884ec27761b8ba1425aa12c.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.5f719fe5e2e4d76f7c0a70befd954e9f.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/app.5f719fe5e2e4d76f7c0a70befd954e9f.css.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.5e46eaca16c640c0bbf5.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.5e46eaca16c640c0bbf5.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/vendor.b2299056e030e9dd4cb8.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/vendor.b2299056e030e9dd4cb8.js.map


+ 1 - 2
src/components/components/askStatic2.vue

@@ -200,7 +200,7 @@ export default {
     };
   },
   computed: {
-    renderedFormula() {
+        renderedFormula() {
       return function(val){
         try {
            // 判断是否含有HTML标签,<tag ...>...</tag>
@@ -316,7 +316,6 @@ export default {
 
 .a_add_head >>> .katex {
   font-size: 16px;
-  display: block;
   width: 100%;
   white-space: normal;
 }

+ 0 - 2
src/components/components/choseWorksDetailDialog.vue

@@ -56,7 +56,6 @@
                       v-if="[72].includes(toolType)"
                     @click="upLoadApp">作业提交</el-button>
                   </div>
-
                   <span v-if="testData.toolDetail"><span v-html="renderedFormula(testData.toolDetail)"></span></span>
 									<span v-else>无</span>
                 </div>
@@ -4390,7 +4389,6 @@ ol {
 
 .a_add_head >>> .katex {
   font-size: 16px;
-  display: block;
   width: 100%;
   white-space: normal;
 }

+ 25 - 16
src/components/components/sortToolWorkShow.vue

@@ -6,11 +6,11 @@
                     <div class="con" style="width: 30%;">
                         <div>句子</div>
                         <div v-for="(i,index) in e" :key="index" style="display: flex;align-items: center;">
-                            <el-tooltip class="item" effect="dark" :content="i.value" placement="top-start">
-                             <div class="TitTimu" :style="{color:i.value == i.trA? '#409EFF' :'' }">{{ i.value }}</div>
+                            <el-tooltip class="item" effect="dark" :content="i.value.join(' ')" placement="top-start">
+                             <div class="TitTimu" :style="{color:JSON.stringify(i.value) == JSON.stringify(i.trA)? '#409EFF' :'' }">{{ i.value.join(' ') }}</div>
                             </el-tooltip>
                             
-                            <img style="height: 15px;width: 15px;margin-left: 10px;" v-if="i.value == i.trA" src="../../assets/right.png" alt="">
+                            <img style="height: 15px;width: 15px;margin-left: 10px;" v-if="JSON.stringify(i.value) == JSON.stringify(i.trA)" src="../../assets/right.png" alt="">
                         </div>
                         <div>
                             正确率
@@ -23,7 +23,7 @@
                         </div>
                         <template v-if="e.find(k => k.isD)">
                             <span v-for="(i,index) in e" :key="index+'p'">
-                                <span v-if="i.value == i.trA">{{ i.pro }}%</span>
+                                <span v-if="JSON.stringify(i.value) == JSON.stringify(i.trA)">{{ i.pro }}%</span>
                             </span>
                         </template>
                         <span v-else>
@@ -53,9 +53,9 @@
                         <div style="font-size: 18px;color: #000;margin-bottom: 10px;">
                             {{ item.sName }}:
                         </div>
-                        <div>
+                        <div style="display: flex;align-items: center;">
                           答案:<span :style="{color:JSON.parse(item.works)[itemIndex].chooseSenList.join('') == JSON.parse(item.works)[itemIndex].rightAnswer.join('')? '#409EFF' :'' }">
-                                    {{ JSON.parse(item.works)[itemIndex].chooseSenList.join('') }}
+                                    {{ JSON.parse(item.works)[itemIndex].chooseSenList.join(' ') }}
                                 </span>
                             <img style="height: 15px;width: 15px;margin-left: 10px;" 
                             v-if="JSON.parse(item.works)[itemIndex].chooseSenList.join('') == JSON.parse(item.works)[itemIndex].rightAnswer.join('')" 
@@ -115,40 +115,49 @@
 
                 this.PData.forEach(e => {
                     JSON.parse(e.works).forEach((k,kin)=>{
-                        allWork[kin].push(k.chooseSenList.join(''))
+                        allWork[kin].push(k.chooseSenList)
                     })
                 });
 
+                // console.log('llllllll',JSON.parse(JSON.stringify(allWork)));
+                
                 for (let index = 0; index < allWork.length; index++) {
                     groups[index] = this.countDuplicates(allWork[index])
                 }
 
+
+                // console.log('groups',JSON.parse(JSON.stringify(groups)));
+                
+
                 // let groups = this.countDuplicates(allWork)
                 for (let index = 0; index < groups.length; index++) {
                     for (let kin = 0; kin < groups[index].length; kin++) {
+                        console.log('groups[index][kin]',groups[index][kin]);
                         groups[index][kin].pro = 0
-                        groups[index][kin].isD = groups[index][kin].value == JSON.parse(this.PData[0].works)[index].rightAnswer.join('')
-                        groups[index][kin].trA = JSON.parse(this.PData[0].works)[index].rightAnswer.join('')
+
+                        groups[index][kin].isD = JSON.stringify(groups[index][kin].value) == JSON.stringify(JSON.parse(this.PData[0].works)[index].rightAnswer)
+                        groups[index][kin].trA = JSON.parse(this.PData[0].works)[index].rightAnswer
                         groups[index][kin].pro = ((groups[index][kin].count / this.PData.length) * 100).toFixed()
                     }
                 }
 
                 
                 this.sortData = groups
-                // console.log('allWork',allWork);
+                // console.log('sortData',sortData);
 
                 // console.log('groups',groups);
                 
             },
             countDuplicates(arr) {
-                const countMap = {};
-                
-                arr.forEach(item => {
-                    countMap[item] = (countMap[item] || 0) + 1;
+                const map = new Map();
+    
+                arr.forEach(subArr => {
+                    const key = JSON.stringify(subArr);
+                    map.set(key, (map.get(key) || 0) + 1);
                 });
                 
-                return Object.entries(countMap).map(([value, count]) => ({
-                    value,
+                return Array.from(map).map(([key, count]) => ({
+                    value: JSON.parse(key),
                     count
                 }));
             },

+ 0 - 1
src/components/components/studentWorkPreviewDialog.vue

@@ -511,7 +511,6 @@ export default {
 
 .studentWorkPreviewDialog >>> .katex {
   font-size: 16px;
-  display: block;
   width: 100%;
   white-space: normal;
 }

+ 56 - 34
src/components/easy2/studyStudent.vue

@@ -522,7 +522,7 @@
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                         ].taskDetail)
                       : '暂无描述'
@@ -22776,10 +22776,10 @@ export default {
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
-          }
-          // else {
+          }else {
             this.getCourseState(1);
-          // }
+          }
+          
           //  || (this.splitScreenData.isOpen && this.splitScreenData.uid != this.splitScreenData.myUid)
 					if ((this.IsFollow && this.tType == 2)) {
             this.setContent2(false);
@@ -26197,45 +26197,68 @@ export default {
     this.updateSplitScreenData(1);
   },
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
       return function(val){
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有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, '');
+            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 {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
-            } 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}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           return val;
@@ -30960,7 +30983,6 @@ div::-webkit-scrollbar {
 }
 .pb_content >>> .katex {
   font-size: 16px;
-  display: block;
   width: 100%;
   white-space: normal;
 }

+ 56 - 36
src/components/easy3/studyStudent.vue

@@ -537,7 +537,7 @@
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                         ].taskDetail)
                       : '暂无描述'
@@ -13172,7 +13172,7 @@ export default {
           {
             role: "user",
             content:
-               `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
+              `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
           },
         ],
         uid: this.userid,
@@ -18203,11 +18203,9 @@ export default {
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
-          }
-
+          }else {
             this.getCourseState(1);
-
-
+          }
 
 					if ((this.IsFollow && this.tType == 2)) {
             this.setContent2(false);
@@ -21554,45 +21552,68 @@ export default {
 		this.updateSplitScreenData(1);
   },
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
       return function(val){
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有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 {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
-            } 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}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           return val;
@@ -22062,7 +22083,6 @@ export default {
 }
 .pb_content >>> .katex {
   font-size: 16px;
-  display: block;
   width: 100%;
   white-space: normal;
 }

+ 60 - 38
src/components/studyStudent.vue

@@ -500,9 +500,9 @@
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
-                        ].taskDetail)
+                        ].taskDetail)  
                       : '暂无描述'
                   "
                 ></div>
@@ -4425,7 +4425,7 @@
                               cursor: pointer;
                             "
                           >
-                            {{ index + 1 + "、"  }} <span v-html="renderedFormula(item.teststitle)"></span>
+                              {{ index + 1 + "、"  }} <span v-html="renderedFormula(item.teststitle)"></span>
                           </div>
                         </el-tooltip>
                       </div>
@@ -9603,7 +9603,7 @@
                 >
                   (多选题)
                 </div>
-                <div>题目:<span v-html="renderedFormula(testJson.testJson[index1].teststitle)"></span></div>
+                  <div>题目:<span v-html="renderedFormula(testJson.testJson[index1].teststitle)"></span></div>
               </div>
               <img
                 v-if="testJson.testJson[index1].img"
@@ -13108,7 +13108,7 @@ export default {
           {
             role: "user",
             content:
-             `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
+            `Role: 你是一名小学英语作文的老师,根据这篇文章的内容你去批改这篇文章,然后仅输出一篇纠错好的文章。文章:${t}`,
           },
         ],
         uid: this.userid,
@@ -18146,10 +18146,9 @@ export default {
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
-          }
-          //  else {
+          }else {
             this.getCourseState(1);
-          // }
+          }
 
           if ((this.IsFollow && this.tType == 2)) {
             this.setContent2(false);
@@ -21506,44 +21505,68 @@ export default {
 		this.updateSplitScreenData(1);
   },
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
       return function(val){
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有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 {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
-            } 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}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           return val;
@@ -21559,7 +21582,7 @@ export default {
           ? c
               .replaceAll(/\r\n/g, "<br/>")
               .replaceAll(/\n/g, "<br/>")
-              .replaceAll(/\s/g, " &nbsp")
+              .replaceAll(/\s/g, "&nbsp")
           : "";
       };
     },
@@ -26194,7 +26217,6 @@ div::-webkit-scrollbar {
 }
 .pb_content >>> .katex {
   font-size: 16px;
-  display: block;
   width: 100%;
   white-space: normal;
 }

+ 55 - 34
src/components/studySutdentClass/studyStudent.vue

@@ -537,7 +537,7 @@
                   v-html="
                     chapInfoList[courseType].chapterInfo[0].taskJson[taskCount]
                       .taskDetail
-                      ? renderedFormula(chapInfoList[courseType].chapterInfo[0].taskJson[
+                      ? renderedFormula2(chapInfoList[courseType].chapterInfo[0].taskJson[
                           taskCount
                         ].taskDetail)
                       : '暂无描述'
@@ -22240,10 +22240,9 @@ export default {
           this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
-          }
-          // else {
+          } else {
             this.getCourseState(1);
-          // }
+          }
 
 					if ((this.IsFollow && this.tType == 2) || (this.splitScreenData.isOpen && this.splitScreenData.uid != this.splitScreenData.myUid)) {
             this.setContent2(false);
@@ -25593,45 +25592,68 @@ export default {
 		this.updateSplitScreenData(1);
   },
   computed: {
+    renderedFormula2() {
+      return function(val){
+        // 处理换行符和HTML实体
+        const normalized = val
+          .replace(/&amp;/g, '&')
+          .replace(/<br\/?>/g, '\n');
+        
+        // 匹配行内公式($...$)和块级公式($$...$$)
+        return normalized.replace(/(\${1,2})([^$]+)(\${1,2})/g, (_, delim, expr) => {
+          try {
+            return katex.renderToString(expr.trim(), {
+              displayMode: false,
+              throwOnError: false,
+              macros: {
+                '\\aligned': '\\begin{aligned}#1\\end{aligned}'
+              }
+            });
+          } catch (e) {
+            console.warn('KaTeX渲染失败:', e);
+            return `<span style="color:red">${expr}</span>`;
+          }
+        })
+      }
+    },
     renderedFormula() {
       return function(val){
         try {
-           // 判断是否含有HTML标签,<tag ...>...</tag>
+        // 判断是否含有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, '');
+            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 {
-                return katex.renderToString(val.trim(), {
-                  throwOnError: false,
-                  strict: false,
-                  output: "htmlAndMathml"
+                html = katex.renderToString(inner.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
                 });
               } catch (e) {
-                return val; // 渲染失败原样输出
+                html = inner;
               }
-            } 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}>`;
-                }
-              );
-            }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
         } catch (e) {
           console.error('KaTeX渲染错误:', e);
           return val;
@@ -30313,7 +30335,6 @@ div::-webkit-scrollbar {
 }
 .pb_content >>> .katex {
   font-size: 16px;
-  display: block;
   width: 100%;
   white-space: normal;
 }

部分文件因为文件数量过多而无法显示