Skip to content

Commit b88ae8d

Browse files
authored
feat: allow markdown.config and markdown.preConfig to accept async function (#4512)
1 parent e035027 commit b88ae8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/node/markdown/markdown.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ export interface MarkdownOptions extends Options {
5353
/**
5454
* Setup markdown-it instance before applying plugins
5555
*/
56-
preConfig?: (md: MarkdownIt) => void
56+
preConfig?: (md: MarkdownIt) => Awaited<void>
5757
/**
5858
* Setup markdown-it instance
5959
*/
60-
config?: (md: MarkdownIt) => void
60+
config?: (md: MarkdownIt) => Awaited<void>
6161
/**
6262
* Disable cache (experimental)
6363
*/
@@ -229,7 +229,7 @@ export async function createMarkdownRenderer(
229229
md.use(restoreEntities)
230230

231231
if (options.preConfig) {
232-
options.preConfig(md)
232+
await options.preConfig(md)
233233
}
234234

235235
// custom plugins
@@ -322,7 +322,7 @@ export async function createMarkdownRenderer(
322322

323323
// apply user config
324324
if (options.config) {
325-
options.config(md)
325+
await options.config(md)
326326
}
327327

328328
return md

0 commit comments

Comments
 (0)