Skip to content

Commit 142f564

Browse files
committed
fix: allow user to override render function
1 parent 2f5c976 commit 142f564

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ export class MarkdownItAsync extends MarkdownIt {
4343
this.map = map
4444
}
4545

46-
render(_src: string, _env?: any): string {
47-
throw new Error('Use `.renderAsync` instead')
48-
}
49-
5046
async renderAsync(src: string, env?: any): Promise<string> {
51-
const result = super.render(src, env)
47+
const result = this.render(src, env)
5248
return replaceAsync(result, placeholderRe, async (match, id) => {
5349
if (!this.map.has(id))
5450
throw new Error(`Unknown highlight placeholder id: ${id}`)

0 commit comments

Comments
 (0)