MCPcopy
hub / github.com/chenglou/pretext / buildCodeBlock

Function buildCodeBlock

pages/demos/markdown-chat.model.ts:551–560  ·  view source on GitHub ↗
(text: string, ctx: ParseContext)

Source from the content-addressed store, hash-verified

549}
550
551function buildCodeBlock(text: string, ctx: ParseContext): PreparedCodeBlock {
552 return {
553 ...createBlockBase(ctx),
554 kind: 'code',
555 lineHeight: CODE_LINE_HEIGHT,
556 prepared: prepareWithSegments(stripSingleTrailingNewline(text), `500 12px ${MONO_FAMILY}`, {
557 whiteSpace: 'pre-wrap',
558 }),
559 }
560}
561
562function buildRuleBlock(ctx: ParseContext): PreparedRuleBlock {
563 return {

Callers 1

parseBlockTokensFunction · 0.85

Calls 3

prepareWithSegmentsFunction · 0.90
createBlockBaseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…