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

Function open

packages/session-ui/src/components/markdown-stream.ts:31–40  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

29}
30
31function open(raw: string) {
32 const match = raw.match(/^[ \t]{0,3}(`{3,}|~{3,})/)
33 if (!match) return false
34 const mark = match[1]
35 if (!mark) return false
36 const char = mark[0]
37 const size = mark.length
38 const last = raw.trimEnd().split("\n").at(-1)?.trim() ?? ""
39 return !new RegExp(`^[\\t ]{0,3}${char}{${size},}[\\t ]*$`).test(last)
40}
41
42function closesFence(raw: string, suffix: string) {
43 const mark = raw.match(/^[ \t]{0,3}(`{3,}|~{3,})/)?.[1]

Callers 1

streamFunction · 0.70

Calls 1

atMethod · 0.80

Tested by

no test coverage detected