Skip to content

Commit fc8c294

Browse files
committed
fix: prevent undefined error
1 parent 418852c commit fc8c294

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/parser/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function compileHast(this: any, options: MDCParseOptions = {}) {
1717
}
1818
}
1919

20-
const position: NodePosition | undefined = node.position?.start?.offset
20+
const position: NodePosition | undefined = (node.position?.start?.offset && node.position?.end?.offset)
2121
? {
2222
start: node.position.start.offset!,
2323
end: node.position.end.offset!

0 commit comments

Comments
 (0)