Creates a MarkdownParser that delegates to a markdown-it instance's render method.
markdown-it
render
The consumer must install markdown-it themselves and pass in the bound render function — this library never imports markdown-it directly.
A function that takes a Markdown string and returns an HTML string. Typically (md) => md.render(md) where md is a configured MarkdownIt instance.
(md) => md.render(md)
md
MarkdownIt
A MarkdownParser instance.
import MarkdownIt from 'markdown-it';import { MARKDOWN_PARSER, createMarkdownItParser } from '@theredhead/lucid-kit';const mdit = new MarkdownIt();providers: [ { provide: MARKDOWN_PARSER, useValue: createMarkdownItParser(md => mdit.render(md)), },] Copy
import MarkdownIt from 'markdown-it';import { MARKDOWN_PARSER, createMarkdownItParser } from '@theredhead/lucid-kit';const mdit = new MarkdownIt();providers: [ { provide: MARKDOWN_PARSER, useValue: createMarkdownItParser(md => mdit.render(md)), },]
Creates a MarkdownParser that delegates to a
markdown-itinstance'srendermethod.The consumer must install
markdown-itthemselves and pass in the boundrenderfunction — this library never importsmarkdown-itdirectly.