Skip to content

Commit c781d37

Browse files
authored
Enable support for highlighting TypeScript code (#975)
1 parent b3b1f45 commit c781d37

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/setup-utils/vue-config-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function baseChainWebpack(config) {
6363
}]);
6464

6565
// Limit highlight.js to only the necessary languages
66-
const builtinLanguages = 'bash|c|s?css|cpp|diff|http|java|llvm|perl|php|python|ruby|xml|javascript|json|markdown|objectivec|shell|swift|yaml';
66+
const builtinLanguages = 'bash|c|s?css|cpp|diff|http|java|llvm|perl|php|python|ruby|xml|javascript|json|markdown|objectivec|shell|swift|typescript|yaml';
6767
const envLanguages = (process.env.VUE_APP_HLJS_LANGUAGES ?? '').split(',').join('|');
6868
config
6969
.plugin('LanguagesPlugin')

src/utils/syntax-highlight.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const Languages = {
3636
scss: [],
3737
shell: ['console', 'shellsession'],
3838
swift: [],
39+
typescript: ['typescript', 'ts', 'tsx', 'mts', 'cts'],
3940
xml: ['html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist', 'wsf', 'svg'],
4041
yaml: ['yml', 'yaml'],
4142
// load more languages from the environment

0 commit comments

Comments
 (0)