MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / renderSpan

Function renderSpan

src/common/markdown-span.ts:143–155  ·  view source on GitHub ↗
(spans: TaggedSpan[])

Source from the content-addressed store, hash-verified

141}
142
143export function renderSpan(spans: TaggedSpan[]): StyledSpan[] {
144 const styled: StyledSpan[] = [];
145 for (const span of spans) {
146 if (span.tag === 'b') styled.push({ weight: 'bold', content: span.s });
147 else if (span.tag === 'i') styled.push({ italic: true, content: span.s });
148 else if (span.tag === 'em')
149 styled.push({ italic: true, weight: 'bold', content: span.s });
150 else if (span.tag === 'code')
151 styled.push({ mono: true, fg: 'yellow', content: span.s });
152 else styled.push({ content: span.s });
153 }
154 return styled;
155}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected