fix: 修复 CRLF 换行文件下 parseTasks 解析失败导致任务进度误判
This commit is contained in:
@@ -2,7 +2,7 @@ import type { TaskItem } from "../types.ts";
|
|||||||
|
|
||||||
export function parseTasks(content: string): TaskItem[] {
|
export function parseTasks(content: string): TaskItem[] {
|
||||||
const tasks: TaskItem[] = [];
|
const tasks: TaskItem[] = [];
|
||||||
const lines = content.split("\n");
|
const lines = content.split(/\r?\n/);
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
const match = line.match(/^[\s]*- \[([ xX])\] (.*)$/);
|
const match = line.match(/^[\s]*- \[([ xX])\] (.*)$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
|
|||||||
Reference in New Issue
Block a user