Plugin โ€บ registerMarkdownCodeBlockProcessor

Plugin.registerMarkdownCodeBlockProcessor() method

Register a special post processor that handles fenced code given a language and a handler. This special post processor takes care of removing the <pre><code> and create a <div> that will be passed to the handler, and is expected to be filled with custom elements.

Signature:

registerMarkdownCodeBlockProcessor(language: string, handler: (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => Promise<any> | void, sortOrder?: number): MarkdownPostProcessor;

Parameters

ParameterTypeDescription
languagestring
handler(source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) โ‡’ Promise<any> | void
sortOrdernumber(Optional)

Returns:

MarkdownPostProcessor