Improve handling tags + improve combine bullets in ntfy backend
This commit is contained in:
@@ -42,7 +42,7 @@ labelWhitespace = whitespace:[ \t\r]+ {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = "#" tag:[a-zA-Z0-9-]+ {
|
tag = "#" tag:[a-zA-Z0-9-/]+ {
|
||||||
return {
|
return {
|
||||||
span: "tag",
|
span: "tag",
|
||||||
value: tag.join("")
|
value: tag.join("")
|
||||||
|
|||||||
@@ -164,10 +164,10 @@ function defaultMapper(task: Task): NtfyDTO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultCombineMapper(tasks: Task[], bullet = "-"): NtfyDTO {
|
function defaultCombineMapper(tasks: Task[], bullet = (index: number) => "-"): NtfyDTO {
|
||||||
const text = tasks
|
const text = tasks
|
||||||
.toSorted((a, b) => b.priority - a.priority)
|
.toSorted((a, b) => b.priority - a.priority)
|
||||||
.map(t => `${bullet} ${t.label}`)
|
.map((t, i) => `${bullet(i)} ${t.label}`)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
|
|
||||||
const priority = mapPriority(Math.max(...tasks.map(t => t.priority)));
|
const priority = mapPriority(Math.max(...tasks.map(t => t.priority)));
|
||||||
|
|||||||
Reference in New Issue
Block a user