Skip to content

Commit ea30fc7

Browse files
committed
fix: check highlight for undefined value
1 parent 1462c3f commit ea30fc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/parser/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const parseMarkdown = async (md: string, inlineOptions: MDCParseOptions =
3232
]
3333

3434
// TODO: remove the passing in @nuxt/content and then we could remove this line
35-
if (inlineOptions.highlight != null && inlineOptions.highlight != false && typeof inlineOptions.highlight.highlighter !== 'function') {
35+
if (inlineOptions.highlight != null && inlineOptions.highlight != false && inlineOptions.highlight.highlighter !== undefined && typeof inlineOptions.highlight.highlighter !== 'function') {
3636
if (import.meta.dev)
3737
console.warn('[@nuxtjs/mdc] `highlighter` passed to `parseMarkdown` is should be a function, but got ' + JSON.stringify(inlineOptions.highlight.highlighter) + ', ignored.')
3838
inlineOptions = {

0 commit comments

Comments
 (0)