Skip to content

Commit 7a9b125

Browse files
committed
Fix regex for simple-time-tracker block extraction: adjust regex to ensure proper matching and add a TODO for block creation.
1 parent 3ac1698 commit 7a9b125

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/front-matter-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,10 @@ export class FrontMatterManager {
199199
const content = await this.app.vault.read(file);
200200
// Extract the dedicated simple-time-tracker block.
201201
// It must begin and end on its own line.
202-
const blockRegex = /^```simple-time-tracker\s*\n([\s\S]*?)\n```/m;
202+
const blockRegex = /^```simple-time-tracker\s*\n([\s\S]*?)```/m;
203203
const blockMatch = content.match(blockRegex);
204204
if (!blockMatch) {
205+
// TODO: then create it and return current Date now (or from notes in TimeFolder)
205206
throw new Error("No dedicated simple-time-tracker block found.");
206207
}
207208
const blockContent = blockMatch[1];

0 commit comments

Comments
 (0)