Lines Matching refs:ctx
198 renderToken(token: Token, ctx: RenderingContext): string {
203 return this.list(token, ctx);
205 return this.listItem(token, ctx);
207 return this.paragraph(token, ctx);
209 return this.text(token, ctx);
213 return this.code(token, ctx);
215 return this.blockquote(token, ctx);
233 list(token: ListToken, ctx: { indent?: number }): string {
237 ...ctx,
245 listItem(token: ListItemToken, ctx: RenderingContext): string {
246 const indent = ctx.indent ?? 0;
247 const bullet = ctx.orderedList ? `${ctx.itemIndex ?? 1}.` : '-';
253 output += this.renderToken(token.tokens[0], ctx).trim() + EOL;
257 output += this.renderToken(child, { ...ctx, indent: indent + 1 }).trimRight() + EOL;
262 paragraph(token: ParagraphToken, ctx: RenderingContext): string {
263 return this.indent(ctx.indent) + token.text + EOL;
266 text(token: TextToken, ctx: RenderingContext): string {
268 return this.indent(ctx.indent) + token.text;
276 code(token: CodeToken, ctx: RenderingContext): string {
278 const indentStr = this.indent(ctx?.indent);
286 blockquote(token: BlockquoteToken, ctx: RenderingContext): string {
287 const indentStr = this.indent(ctx.indent);
292 .map((child) => '> ' + this.renderToken(child, { ...ctx, indent: 0 }).trimRight())