Give each task an assigned colour across the UI; lead links tasks
This commit is contained in:
Vendored
+5
@@ -1,5 +1,6 @@
|
||||
import { h } from "./dom.js";
|
||||
import { diagram } from "./mermaid.js";
|
||||
import { taskStyle } from "./taskcolor.js";
|
||||
const choiceMarker = /^(\([ *]\)|\[[ xX]\])\s+(\S.*?)\s*$/;
|
||||
const detailsOpen = /^\s*<details>\s*(?:<summary>(.*?)<\/summary>)?\s*$/i;
|
||||
const summaryLine = /^\s*<summary>(.*?)<\/summary>\s*$/i;
|
||||
@@ -270,6 +271,10 @@ function link(href, children) {
|
||||
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