Give each task an assigned colour across the UI; lead links tasks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { h } from "./dom.js";
|
||||
import { diagram } from "./mermaid.js";
|
||||
import { taskStyle } from "./taskcolor.js";
|
||||
|
||||
type Block = HTMLElement;
|
||||
|
||||
@@ -310,6 +311,10 @@ function link(href: string, children: Node[]): Node {
|
||||
if (/^https?:\/\//i.test(href)) {
|
||||
return h("a", { href, target: "_blank", rel: "noopener noreferrer" }, ...children);
|
||||
}
|
||||
const task = /^#\/task\/(\w+)$/.exec(href);
|
||||
if (task) {
|
||||
return h("a", { href, class: "task-link", style: taskStyle(task[1]!) }, ...children);
|
||||
}
|
||||
if (href.startsWith("#/")) {
|
||||
return h("a", { href }, ...children);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user