The source for Markdown (0037-planningFR-026): each task list item of GitHub Flavored Markdown 0.29-gfm section 5.3 is an item. A task list item is a list item whose first block is a paragraph that begins with a marker (optional spaces, [, a whitespace character or x or X, ]) and at least one whitespace character before any other content, under any list marker the list allows (-, +, *, or an ordered number with . or )); unchecked where the character is whitespace and checked otherwise. A task nested under another is its child, linked as parent of. Closing an item changes the one character between the brackets to x, reopening it to a space, and no other byte; a task list in a fenced code block is not read.
The reader works on lines: a list item is a line of optional indentation, a list marker, one or more spaces or a tab and its content; a child is a list item indented at least to the content of the one above; continuation lines indented to the content are the item's body. It reads no list inside a block quote and takes a lazy continuation line as part of the item above, which is the common shape of tasks.md and of the body of an issue. The checked state of Markdown says only done, so a task checked reads as closed as completed and a close for another reason cannot be written and goes to the outbox.
typeTask= {
readonlystartLine:number;
readonlyendLine:number;
/** The index in its line of the character between the brackets. */readonlymarkIndex:number;
readonlymark:string;
readonlytitle:string;
readonlybody:string;
readonlyownText:string;
readonlyparentLine:number|undefined;
};
A task found in a text: where it is, what it says and how it nests.
typeTask= {
readonlystartLine:number;
readonlyendLine:number;
/** The index in its line of the character between the brackets. */readonlymarkIndex:number;
readonlymark:string;
readonlytitle:string;
readonlybody:string;
readonlyownText:string;
readonlyparentLine:number|undefined;
};
A task found in a text: where it is, what it says and how it nests.