Add copy buttons to code blocks and tool input and output
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { h } from "./dom.js";
|
||||
import { copyable, h } from "./dom.js";
|
||||
import { diagram } from "./mermaid.js";
|
||||
import { taskStyle } from "./taskcolor.js";
|
||||
|
||||
@@ -50,7 +50,7 @@ function blocks(lines: string[], opts: Options): Block[] {
|
||||
i++;
|
||||
}
|
||||
i++;
|
||||
out.push(f[2]!.toLowerCase() === "mermaid" ? diagram(body.join("\n")) : h("pre", { class: "md-code" }, h("code", {}, body.join("\n"))));
|
||||
out.push(f[2]!.toLowerCase() === "mermaid" ? diagram(body.join("\n")) : copyable(h("pre", { class: "md-code" }, h("code", {}, body.join("\n")))));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user