Skip to content

Commit 816c411

Browse files
fix runtime error
1 parent e3a2015 commit 816c411

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

packages/core/src/file.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ export class File {
8787

8888
this.ast = _highlighter.getAST(this.raw, this.fileName, this.lang);
8989

90+
if (!this.ast) return;
91+
9092
const { syntaxFileObject, syntaxFileLineNumber } = _highlighter.processAST(this.ast);
9193

9294
this.syntaxFile = syntaxFileObject;

packages/lowlight/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { processAST, type SyntaxLine } from "./processAST";
44

55
const lowlight = createLowlight(all);
66

7+
// !SEE https://github.com/highlightjs/highlightjs-vue
78
lowlight.register("vue", function hljsDefineVue(hljs) {
89
return {
910
subLanguage: "xml",

0 commit comments

Comments
 (0)