MCPcopy
hub / github.com/agent0ai/agent-zero / formatReplacement

Function formatReplacement

plugins/_editor/webui/editor-store.js:1635–1642  ·  view source on GitHub ↗
(command, selected = "")

Source from the content-addressed store, hash-verified

1633 },
1634
1635 formatReplacement(command, selected = "") {
1636 if (command === "bold") return `**${selected || "text"}**`;
1637 if (command === "italic") return `*${selected || "text"}*`;
1638 if (command === "list") return (selected || "item").split("\n").map((line) => `- ${line.replace(/^[-*]\s+/, "")}`).join("\n");
1639 if (command === "numbered") return (selected || "item").split("\n").map((line, index) => `${index + 1}. ${line.replace(/^\d+\.\s+/, "")}`).join("\n");
1640 if (command === "table") return "| Column | Value |\n| --- | --- |\n| | |";
1641 return selected;
1642 },
1643
1644 queueRender(options = {}) {
1645 if (options.focus) {

Callers

nothing calls this directly

Calls 3

mapMethod · 0.80
replaceMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected