File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,15 @@ export async function highlight({
47
47
await highlighter . loadTheme ( theme as IShikiTheme )
48
48
}
49
49
if ( missingLang ( highlighter , lang ) ) {
50
- await highlighter . loadLanguage ( lang as Lang )
50
+ try {
51
+ await highlighter . loadLanguage ( lang as Lang )
52
+ } catch ( e ) {
53
+ console . warn (
54
+ "[Code Hike warning]" ,
55
+ `${ lang } is not a valid language, no syntax highlighting will be applied.`
56
+ )
57
+ return highlight ( { code, lang : "text" , theme } )
58
+ }
51
59
}
52
60
53
61
const tokenizedLines = highlighter . codeToThemedTokens (
Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ function lorem(ipsum, dolor = 1) {
6
6
}
7
7
```
8
8
9
+ ``` mermaid
10
+ graph LR
11
+ Start1(Start)
12
+ --Bot 启动--> check1[检查群内的非 Authing 用户]
13
+ --> addUser[添加 Authing 用户并消息提醒绑定手机号]
14
+ --> End1(End)
15
+ ```
16
+
9
17
``` js
10
18
function lorem (ipsum , dolor = 1 ) {}
11
19
```
You can’t perform that action at this time.
0 commit comments