Custom task statuses plus various fixes

This commit is contained in:
Zef Hemel
2023-09-01 16:57:29 +02:00
parent 9b5fa44fb6
commit 2ee20af5c8
24 changed files with 374 additions and 118 deletions
+24 -10
View File
@@ -260,16 +260,30 @@ function render(
name: "span",
body: cleanTags(mapRender(t.children!)),
};
case "TaskMarker":
return {
name: "input",
attrs: {
type: "checkbox",
checked: t.children![0].text !== "[ ]" ? "checked" : undefined,
"data-onclick": JSON.stringify(["task", t.to]),
},
body: "",
};
case "TaskState": {
// child[0] = marker, child[1] = state, child[2] = marker
const stateText = t.children![1].text!;
if ([" ", "x", "X"].includes(stateText)) {
return {
name: "input",
attrs: {
type: "checkbox",
checked: t.children![0].text !== "[ ]" ? "checked" : undefined,
"data-onclick": JSON.stringify(["task", t.to]),
},
body: "",
};
} else {
return {
name: "span",
attrs: {
class: "task-state",
},
body: stateText,
};
}
}
case "NamedAnchor":
return {
name: "a",