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

Function finalizePage

plugins/_editor/webui/editor-preview.js:122–135  ·  view source on GitHub ↗
(page, index, source = "")

Source from the content-addressed store, hash-verified

120}
121
122function finalizePage(page, index, source = "") {
123 const start = Math.max(0, Number(page.start || 0));
124 const end = Math.max(start, Number(page.end ?? String(source || "").length));
125 const markdown = String(source || "").slice(start, end) || page.lines.join("\n");
126 return {
127 index,
128 title: page.title,
129 level: page.level,
130 anchor: slugifyHeading(page.title),
131 start,
132 end,
133 markdown,
134 };
135}
136
137function cleanHeadingText(text = "") {
138 return String(text || "")

Callers 2

startPageFunction · 0.85
buildMarkdownPagesFunction · 0.85

Calls 3

slugifyHeadingFunction · 0.85
sliceMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected