@@ -7,18 +7,24 @@ import { Task } from "@/model/task/schema";
7
7
import { SYMBOL_PATH_LOOKUP , SYMBOL_PRIORITY_LOOKUP , SYMBOL_REG_EXP } from "./obsidian-tasks.const" ;
8
8
9
9
/**
10
- * Parses { @link Task} metadata from a real markdown blob using Obsidian Task's emoji format.
10
+ * Parses task metadata from a markdown string using Obsidian Task's emoji format.
11
11
*
12
- * Here's an illustration:
13
- * ```
14
- * // ( symbol & value )
15
- * "the text at the front is assumed to be a description. ❌ cancelled date ➕ creation date ✅ completed date"
16
- * // ( symbol & value ) ( symbol & value )
12
+ * The function extracts the task description (the text preceding the first emoji symbol) and associated metadata.
13
+ * Recognized emoji markers denote fields such as cancellation, creation, completion dates, priority, or dependencies.
17
14
*
18
- * { cancelled: "cancelled date", created: "creation date", done: "completed date" }
15
+ * For example:
16
+ * ```
17
+ * "Prepare slides ❌ 2025-05-01 ➕ 2025-04-20 ✅ 2025-05-05"
18
+ * // Returns an object similar to:
19
+ * // {
20
+ * // description: "Prepare slides",
21
+ * // cancelled: DateTime for "2025-05-01",
22
+ * // created: DateTime for "2025-04-20",
23
+ * // done: DateTime for "2025-05-05"
24
+ * // }
19
25
* ```
20
- * @param text - the text of the task without its' markdown text .
21
- * @returns a {@link Task} with the parsed metadata.
26
+ * @param text - The markdown text containing the task description and metadata formatted with Obsidian Task's emoji syntax .
27
+ * @returns A partial {@link Task} object populated with the extracted metadata.
22
28
* @see {@link https://publish.obsidian.md/tasks/Reference/Task+Formats/Tasks+Emoji+Format }
23
29
*/
24
30
export function parseTaskEmojiFormat ( text : string ) : DeepPartial < Task > {
0 commit comments