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

Function renderHeading

src/common/markdown-block.ts:328–359  ·  view source on GitHub ↗
(block: TaggedHeading)

Source from the content-addressed store, hash-verified

326}
327
328function renderHeading(block: TaggedHeading): StyledBlock {
329 if (block.tag === 'h1') {
330 return {
331 tag: 'paragraph',
332 spans: renderSpans(
333 block.content.map((span) => ({
334 ...span,
335 s: span.s.toUpperCase(),
336 fg: 'blue',
337 }))
338 ),
339 };
340 }
341
342 if (block.tag === 'h2') {
343 return {
344 tag: 'paragraph',
345 spans: renderSpans(
346 block.content.map((span) => ({
347 ...span,
348 s: span.s.toUpperCase(),
349 fg: 'bright-blue',
350 }))
351 ),
352 };
353 }
354
355 return {
356 tag: 'paragraph',
357 spans: renderSpans(block.content),
358 };
359}
360
361function renderBlockquote(block: TaggedBlockQuote): StyledBlock {
362 return {

Callers 1

renderMarkdownBlockFunction · 0.85

Calls 2

renderSpansFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected