Skip to content

Commit 231bac6

Browse files
committed
fix: cleanup top level text nodes
1 parent f5ee5a5 commit 231bac6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/runtime/parser/compiler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ export function compileHast(this: any, options: MDCParseOptions = {}) {
119119
}
120120
}
121121

122+
// Top level text nodes are not allowed
123+
body.children = (body.children || []).filter(child => child.type !== 'text')
124+
122125
return {
123126
body,
124127
excerpt

0 commit comments

Comments
 (0)