diff --git a/src/transform/md.ts b/src/transform/md.ts index fd8fced1..d788b8fb 100644 --- a/src/transform/md.ts +++ b/src/transform/md.ts @@ -118,10 +118,12 @@ function initParser(md: MarkdownIt, options: OptionsType, env: EnvType) { } function initCompiler(md: MarkdownIt, options: OptionsType, env: EnvType) { - const {needToSanitizeHtml = true, sanitizeOptions} = options; + const {needToSanitizeHtml = true, renderInline = false, sanitizeOptions} = options; return (tokens: Token[]) => { - const html = md.renderer.render(tokens, md.options, env); + const html = renderInline + ? md.renderer.renderInline(tokens, md.options, env) + : md.renderer.render(tokens, md.options, env); return needToSanitizeHtml ? sanitizeHtml(html, sanitizeOptions) : html; }; diff --git a/src/transform/typings.ts b/src/transform/typings.ts index c8ff9e55..79ac76db 100644 --- a/src/transform/typings.ts +++ b/src/transform/typings.ts @@ -48,6 +48,7 @@ export interface OptionsType { rootPublicPath?: string; transformLink?: (href: string) => string; getPublicPath?: (options: OptionsType, href?: string) => string; + renderInline?: boolean; [x: string]: unknown; }