Skip to content

Commit ce85726

Browse files
committed
feat(build): add markdown.preConfig option
closes #1382
1 parent 7141b82 commit ce85726

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/node/markdown/markdown.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type ThemeOptions =
3434

3535
export interface MarkdownOptions extends MarkdownIt.Options {
3636
lineNumbers?: boolean
37+
preConfig?: (md: MarkdownIt) => void
3738
config?: (md: MarkdownIt) => void
3839
anchor?: anchorPlugin.AnchorOptions
3940
attrs?: {
@@ -76,10 +77,14 @@ export const createMarkdownRenderer = async (
7677
logger
7778
)),
7879
...options
79-
}) as MarkdownRenderer
80+
})
8081

8182
md.linkify.set({ fuzzyLink: false })
8283

84+
if (options.preConfig) {
85+
options.preConfig(md)
86+
}
87+
8388
// custom plugins
8489
md.use(componentPlugin)
8590
.use(highlightLinePlugin)

0 commit comments

Comments
 (0)