Skip to content

Commit 60bdf22

Browse files
committed
fix: Fix inline rendering beheavior
1 parent 7ada585 commit 60bdf22

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/transform/md.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,11 @@ function initCompiler(md: MarkdownIt, options: OptionsType, env: EnvType) {
121121
const {needToSanitizeHtml = true, renderInline = false, sanitizeOptions} = options;
122122

123123
return (tokens: Token[]) => {
124-
const html = renderInline
125-
? md.renderer.renderInline(tokens, md.options, env)
126-
: md.renderer.render(tokens, md.options, env);
124+
if (renderInline) {
125+
tokens = tokens.filter((token) => token.type === 'inline');
126+
}
127+
128+
const html = md.renderer.render(tokens, md.options, env);
127129

128130
return needToSanitizeHtml ? sanitizeHtml(html, sanitizeOptions) : html;
129131
};

0 commit comments

Comments
 (0)