MCPcopy Create free account
hub / github.com/chhoumann/quickadd / body

Function body

src/utils/extractScriptFromMarkdown.test.ts:9–12  ·  view source on GitHub ↗

* Strip the line-number-preserving leading newlines and the single structural * trailing newline (the terminator of the last body line) so assertions read * cleanly. Byte-exact preservation is asserted separately in the CRLF test.

(content: string)

Source from the content-addressed store, hash-verified

7 * cleanly. Byte-exact preservation is asserted separately in the CRLF test.
8 */
9function body(content: string): string | null {
10 const { code } = extractScriptFromMarkdown(content);
11 return code === null ? null : code.replace(/^\n+/, "").replace(/\r?\n$/, "");
12}
13
14describe("extractScriptFromMarkdown", () => {
15 it("returns null when there is no code fence", () => {

Calls 1

Tested by

no test coverage detected