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 {
|
||||
span: "tag",
|
||||
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
|
||||
.toSorted((a, b) => b.priority - a.priority)
|
||||
.map(t => `${bullet} ${t.label}`)
|
||||
.map((t, i) => `${bullet(i)} ${t.label}`)
|
||||
.join("\n");
|
||||
|
||||
const priority = mapPriority(Math.max(...tasks.map(t => t.priority)));
|
||||
|
||||
Reference in New Issue
Block a user