MCPcopy
hub / github.com/marktext/marktext / output

Method output

packages/muya/src/inlineRenderer/renderer/index.ts:158–175  ·  view source on GitHub ↗
(tokens: Token[], block: Format, cursor: ICursor)

Source from the content-addressed store, hash-verified

156 }
157
158 output(tokens: Token[], block: Format, cursor: ICursor) {
159 const children: VNode[] = tokens.reduce(
160 (acc, token) => [
161 ...acc,
162 ...this.dispatch(snakeToCamel(token.type), {
163 h,
164 cursor,
165 block,
166 token,
167 }),
168 ],
169 [] as VNode[],
170 );
171 const vNode = h('span', children);
172 const rawHtml = toHTML(vNode);
173
174 return rawHtml.replace(/^<span>([\s\S]*)<\/span>$/g, (_, p) => p);
175 }
176}
177
178export default Renderer;

Callers 3

patchMethod · 0.80
inlineLexer.jsFile · 0.80
parser.jsFile · 0.80

Calls 5

dispatchMethod · 0.95
snakeToCamelFunction · 0.90
hFunction · 0.85
reduceMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected