Inbox consideration
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { copyable, h } from "./dom.js";
|
||||
import { diagram } from "./mermaid.js";
|
||||
import { taskStyle } from "./taskcolor.js";
|
||||
import { todoLink } from "./todolink.js";
|
||||
|
||||
type Block = HTMLElement;
|
||||
|
||||
@@ -315,6 +316,14 @@ function link(href: string, children: Node[]): Node {
|
||||
if (task) {
|
||||
return h("a", { href, class: "task-link", style: taskStyle(task[1]!) }, ...children);
|
||||
}
|
||||
const todo = /^#\/todo\/(\w+)\/(.+)$/.exec(href);
|
||||
if (todo) {
|
||||
try {
|
||||
return todoLink(todo[1]!, decodeURIComponent(todo[2]!), children);
|
||||
} catch {
|
||||
return h("span", {}, ...children);
|
||||
}
|
||||
}
|
||||
if (href.startsWith("#/")) {
|
||||
return h("a", { href }, ...children);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user