MCPcopy Create free account
hub / github.com/Noumena-Network/code / isFenceClose

Function isFenceClose

src/utils/markdown.ts:96–106  ·  view source on GitHub ↗
(
  line: string,
  fence: { marker: '`' | '~'; size: number } | null,
)

Source from the content-addressed store, hash-verified

94}
95
96function isFenceClose(
97 line: string,
98 fence: { marker: '`' | '~'; size: number } | null,
99): boolean {
100 if (!fence) return false
101 const match = line.match(/^[ ]{0,3}(`{3,}|~{3,})[ \t]*$/)
102 if (!match) return false
103 const raw = match[1]
104 if (!raw) return false
105 return raw[0] === fence.marker && raw.length >= fence.size
106}
107
108function getLineStartOffsets(lines: string[]): number[] {
109 const offsets: number[] = []

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected