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