Skip to content

MarkdownPreviewRenderer.createCodeBlockPostProcessor method

MarkdownPreviewRenderer › createCodeBlockPostProcessor

Official

Create a code block post processor.

Signature:

createCodeBlockPostProcessor(language: string, handler: (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => void | Promise<any>): (el: HTMLElement, ctx: MarkdownPostProcessorContext) => void

Parameters:

ParameterTypeDescription
languagestringThe language of the code block.
handler(source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => void | Promise<any>Renders the code block, given its source, the element to render into, and the context.

Returns: (el: HTMLElement, ctx: MarkdownPostProcessorContext) => void

Since: 0.12.11