Add copy buttons to code blocks and tool input and output
This commit is contained in:
Vendored
+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";
|
||||
const choiceMarker = /^(\([ *]\)|\[[ xX]\])\s+(\S.*?)\s*$/;
|
||||
@@ -37,7 +37,7 @@ function blocks(lines, opts) {
|
||||
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;
|
||||
}
|
||||
if (detailsClose.test(line)) {
|
||||
|
||||
Reference in New Issue
Block a user