MCPcopy Create free account
hub / github.com/anomalyco/opencode / closesFence

Function closesFence

packages/session-ui/src/components/markdown-stream.ts:42–46  ·  view source on GitHub ↗
(raw: string, suffix: string)

Source from the content-addressed store, hash-verified

40}
41
42function closesFence(raw: string, suffix: string) {
43 const mark = raw.match(/^[ \t]{0,3}(`{3,}|~{3,})/)?.[1]
44 if (!mark) return suffix.includes("```") || suffix.includes("~~~")
45 return `${raw.slice(-(mark.length - 1))}${suffix}`.includes(mark)
46}
47
48function heal(text: string) {
49 return remend(text, { linkMode: "text-only" })

Callers 1

projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected