Skip to content

Commit 2eabf92

Browse files
committed
refactor(code view): convert custom language file from JS to TS
1 parent 72b500b commit 2eabf92

File tree

4 files changed

+26
-838
lines changed

4 files changed

+26
-838
lines changed

src/common/highlight/bash.js

-153
This file was deleted.

src/common/highlight/bash.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import bash from 'highlight.js/lib/languages/bash'
2+
import { isString } from 'lodash'
3+
4+
export default (hljs: any) => {
5+
const ret = bash?.(hljs)
6+
if (ret?.keywords?.built_in && isString(ret.keywords.built_in)) {
7+
ret.keywords.built_in = ret.keywords.built_in.replace(
8+
'read readarray source type typeset ulimit unalias ',
9+
($0: string) => `${$0}docker tar wget `,
10+
)
11+
}
12+
13+
return ret
14+
}

0 commit comments

Comments
 (0)