Allow options.markdownItFactory to be implemented asynchronously so the markdown-it parser import can be deferred.

This commit is contained in:
David Anson 2024-12-27 21:22:14 -08:00
parent d4b981bcb3
commit 44c302fe0b
6 changed files with 448 additions and 249 deletions

View file

@ -373,7 +373,7 @@ export type MarkdownIt = {
/**
* Gets an instance of the markdown-it parser. Any plugins should already have been loaded.
*/
export type MarkdownItFactory = () => MarkdownIt;
export type MarkdownItFactory = () => MarkdownIt | Promise<MarkdownIt>;
/**
* Configuration options.
*/