소스 검색

fix: bug fixed (#773) (#831)

Mccurtain 3 주 전
부모
커밋
0ed4caa043
1개의 변경된 파일과 3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      resources/GDOU/gdou.js

+ 3 - 2
resources/GDOU/gdou.js

@@ -67,8 +67,9 @@ function parseWeeks(weekStr) {
         const item = group.trim();
 
         // 先尝试匹配 "起-止周",再尝试匹配单个周次
-        const rangeMatch = item.match(/(\d+)\s*-\s*(\d+)\s*周?/);
-        const singleMatch = item.match(/^(\d+)\s*周?/);
+        // 兼容"第1-8周"、"1-8周"、"第3周"、"3周"格式
+        const rangeMatch = item.match(/第?(\d+)\s*-\s*(\d+)\s*周?/);
+        const singleMatch = item.match(/第?(\d+)\s*周?/);
 
         let start = 0;
         let end = 0;