MCPcopy Create free account
hub / github.com/Moyf/easy-copy / parseFenceLength

Function parseFenceLength

src/codeBlockDetect.ts:3–8  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

1import { CodeBlockBehavior, ContextData, ContextType } from './type';
2
3function parseFenceLength(line: string): number {
4 const trimmed = line.trimStart();
5 const match = trimmed.match(/^(`{3,})/);
6 if (!match) return 0;
7 return match[1].length;
8}
9
10function isClosingFence(line: string, minLen: number): boolean {
11 const trimmed = line.trimStart();

Callers 1

detectCodeBlockFromLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected