Przeglądaj źródła

Merge branch 'pending' of https://github.com/XingHeYuZhuan/shiguang_warehouse into pending

XingHeYuZhuan 6 godzin temu
rodzic
commit
0bd0be77d3
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      resources/IMNC/imnc_01.js

+ 10 - 0
resources/IMNC/imnc_01.js

@@ -3,6 +3,11 @@
  * 放置于测试目录用于真机测试
  */
 
+// 清理 <wbr> 标签
+function cleanWbr(str) {
+    return str ? str.replace(/<wbr\s*\/?>/gi, '') : str;
+}
+
 // 周次解析函数
 function parseWeeks(weekStr) {
     let weeks = [];
@@ -72,6 +77,11 @@ function fetchAndParseCourses() {
                     if (nameMatch2) name = nameMatch2[1];
                 }
                 
+                // 清理 <wbr> 标签
+                name = cleanWbr(name);
+                position = cleanWbr(position);
+                teacher = cleanWbr(teacher);
+                
                 let weeks = parseWeeks(weekStr);
                 
                 // 查找同一天、同名、同老师、同地点、同周次,且正好是上一节的课程(合并连上的课)