Skip to content

Commit 502ed8d

Browse files
committed
fix: update grammar registry, fix html in markdown highlighting
1 parent 5041e1e commit 502ed8d

10 files changed

+74
-24
lines changed

docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"shiki": "workspace:*",
2121
"unocss": "^0.58.4",
2222
"unplugin-vue-components": "^0.26.0",
23-
"vitepress": "^1.0.0-rc.40",
23+
"vitepress": "^1.0.0-rc.41",
2424
"vue": "^3.4.15"
2525
}
2626
}

packages/shiki/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"@shikijs/core": "workspace:*"
103103
},
104104
"devDependencies": {
105-
"tm-grammars": "^1.1.1",
105+
"tm-grammars": "^1.1.2",
106106
"tm-themes": "^1.1.1",
107107
"vscode-oniguruma": "^1.7.0"
108108
}

packages/shiki/src/assets/langs-bundle-full.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const bundledLanguagesInfo: BundledLanguageInfo[] = [
191191
},
192192
{
193193
'id': 'csv',
194-
'name': 'csv syntax',
194+
'name': 'CSV',
195195
'import': (() => import('./langs/csv')) as DynamicImportLanguageRegistration
196196
},
197197
{
@@ -419,6 +419,11 @@ export const bundledLanguagesInfo: BundledLanguageInfo[] = [
419419
'name': 'HTML',
420420
'import': (() => import('./langs/html')) as DynamicImportLanguageRegistration
421421
},
422+
{
423+
'id': 'html-derivative',
424+
'name': 'HTML (Derivative)',
425+
'import': (() => import('./langs/html-derivative')) as DynamicImportLanguageRegistration
426+
},
422427
{
423428
'id': 'http',
424429
'name': 'HTTP',
@@ -1053,7 +1058,7 @@ export const bundledLanguagesBase = Object.fromEntries(bundledLanguagesInfo.map(
10531058

10541059
export const bundledLanguagesAlias = Object.fromEntries(bundledLanguagesInfo.flatMap(i => i.aliases?.map(a => [a, i.import]) || []))
10551060

1056-
export type BundledLanguage = 'abap' | 'actionscript-3' | 'ada' | 'angular-html' | 'angular-ts' | 'apache' | 'apex' | 'apl' | 'applescript' | 'ara' | 'asm' | 'astro' | 'awk' | 'ballerina' | 'bash' | 'bat' | 'batch' | 'be' | 'beancount' | 'berry' | 'bibtex' | 'bicep' | 'blade' | 'c' | 'c#' | 'c++' | 'cadence' | 'cdc' | 'clarity' | 'clj' | 'clojure' | 'cmake' | 'cmd' | 'cobol' | 'codeql' | 'coffee' | 'coffeescript' | 'console' | 'cpp' | 'cql' | 'crystal' | 'cs' | 'csharp' | 'css' | 'csv' | 'cue' | 'cypher' | 'd' | 'dart' | 'dax' | 'diff' | 'docker' | 'dockerfile' | 'dream-maker' | 'elixir' | 'elm' | 'erb' | 'erl' | 'erlang' | 'f' | 'f#' | 'f03' | 'f08' | 'f18' | 'f77' | 'f90' | 'f95' | 'fish' | 'for' | 'fortran-fixed-form' | 'fortran-free-form' | 'fs' | 'fsharp' | 'fsl' | 'gdresource' | 'gdscript' | 'gdshader' | 'gherkin' | 'git-commit' | 'git-rebase' | 'gjs' | 'glimmer-js' | 'glimmer-ts' | 'glsl' | 'gnuplot' | 'go' | 'gql' | 'graphql' | 'groovy' | 'gts' | 'hack' | 'haml' | 'handlebars' | 'haskell' | 'hbs' | 'hcl' | 'hjson' | 'hlsl' | 'hs' | 'html' | 'http' | 'imba' | 'ini' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsonnet' | 'jssm' | 'jsx' | 'julia' | 'kotlin' | 'kql' | 'kt' | 'kts' | 'kusto' | 'latex' | 'less' | 'liquid' | 'lisp' | 'logo' | 'lua' | 'make' | 'makefile' | 'markdown' | 'marko' | 'matlab' | 'md' | 'mdc' | 'mdx' | 'mermaid' | 'mojo' | 'nar' | 'narrat' | 'nextflow' | 'nf' | 'nginx' | 'nim' | 'nix' | 'nu' | 'nushell' | 'objc' | 'objective-c' | 'objective-cpp' | 'ocaml' | 'pascal' | 'perl' | 'perl6' | 'php' | 'plsql' | 'postcss' | 'powerquery' | 'powershell' | 'prisma' | 'prolog' | 'properties' | 'proto' | 'ps' | 'ps1' | 'pug' | 'puppet' | 'purescript' | 'py' | 'python' | 'ql' | 'r' | 'raku' | 'razor' | 'rb' | 'reg' | 'rel' | 'riscv' | 'rs' | 'rst' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scala' | 'scheme' | 'scss' | 'sh' | 'shader' | 'shaderlab' | 'shell' | 'shellscript' | 'shellsession' | 'smalltalk' | 'solidity' | 'sparql' | 'spl' | 'splunk' | 'sql' | 'ssh-config' | 'stata' | 'styl' | 'stylus' | 'svelte' | 'swift' | 'system-verilog' | 'tasl' | 'tcl' | 'tex' | 'toml' | 'ts' | 'tsx' | 'turtle' | 'twig' | 'typescript' | 'v' | 'vb' | 'verilog' | 'vhdl' | 'vim' | 'viml' | 'vimscript' | 'vue' | 'vue-html' | 'vy' | 'vyper' | 'wasm' | 'wenyan' | 'wgsl' | 'wl' | 'wolfram' | 'xml' | 'xsl' | 'yaml' | 'yml' | 'zenscript' | 'zig' | 'zsh' | '文言'
1061+
export type BundledLanguage = 'abap' | 'actionscript-3' | 'ada' | 'angular-html' | 'angular-ts' | 'apache' | 'apex' | 'apl' | 'applescript' | 'ara' | 'asm' | 'astro' | 'awk' | 'ballerina' | 'bash' | 'bat' | 'batch' | 'be' | 'beancount' | 'berry' | 'bibtex' | 'bicep' | 'blade' | 'c' | 'c#' | 'c++' | 'cadence' | 'cdc' | 'clarity' | 'clj' | 'clojure' | 'cmake' | 'cmd' | 'cobol' | 'codeql' | 'coffee' | 'coffeescript' | 'console' | 'cpp' | 'cql' | 'crystal' | 'cs' | 'csharp' | 'css' | 'csv' | 'cue' | 'cypher' | 'd' | 'dart' | 'dax' | 'diff' | 'docker' | 'dockerfile' | 'dream-maker' | 'elixir' | 'elm' | 'erb' | 'erl' | 'erlang' | 'f' | 'f#' | 'f03' | 'f08' | 'f18' | 'f77' | 'f90' | 'f95' | 'fish' | 'for' | 'fortran-fixed-form' | 'fortran-free-form' | 'fs' | 'fsharp' | 'fsl' | 'gdresource' | 'gdscript' | 'gdshader' | 'gherkin' | 'git-commit' | 'git-rebase' | 'gjs' | 'glimmer-js' | 'glimmer-ts' | 'glsl' | 'gnuplot' | 'go' | 'gql' | 'graphql' | 'groovy' | 'gts' | 'hack' | 'haml' | 'handlebars' | 'haskell' | 'hbs' | 'hcl' | 'hjson' | 'hlsl' | 'hs' | 'html' | 'html-derivative' | 'http' | 'imba' | 'ini' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsonnet' | 'jssm' | 'jsx' | 'julia' | 'kotlin' | 'kql' | 'kt' | 'kts' | 'kusto' | 'latex' | 'less' | 'liquid' | 'lisp' | 'logo' | 'lua' | 'make' | 'makefile' | 'markdown' | 'marko' | 'matlab' | 'md' | 'mdc' | 'mdx' | 'mermaid' | 'mojo' | 'nar' | 'narrat' | 'nextflow' | 'nf' | 'nginx' | 'nim' | 'nix' | 'nu' | 'nushell' | 'objc' | 'objective-c' | 'objective-cpp' | 'ocaml' | 'pascal' | 'perl' | 'perl6' | 'php' | 'plsql' | 'postcss' | 'powerquery' | 'powershell' | 'prisma' | 'prolog' | 'properties' | 'proto' | 'ps' | 'ps1' | 'pug' | 'puppet' | 'purescript' | 'py' | 'python' | 'ql' | 'r' | 'raku' | 'razor' | 'rb' | 'reg' | 'rel' | 'riscv' | 'rs' | 'rst' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scala' | 'scheme' | 'scss' | 'sh' | 'shader' | 'shaderlab' | 'shell' | 'shellscript' | 'shellsession' | 'smalltalk' | 'solidity' | 'sparql' | 'spl' | 'splunk' | 'sql' | 'ssh-config' | 'stata' | 'styl' | 'stylus' | 'svelte' | 'swift' | 'system-verilog' | 'tasl' | 'tcl' | 'tex' | 'toml' | 'ts' | 'tsx' | 'turtle' | 'twig' | 'typescript' | 'v' | 'vb' | 'verilog' | 'vhdl' | 'vim' | 'viml' | 'vimscript' | 'vue' | 'vue-html' | 'vy' | 'vyper' | 'wasm' | 'wenyan' | 'wgsl' | 'wl' | 'wolfram' | 'xml' | 'xsl' | 'yaml' | 'yml' | 'zenscript' | 'zig' | 'zsh' | '文言'
10571062

10581063
export const bundledLanguages = {
10591064
...bundledLanguagesBase,

packages/shiki/src/assets/langs-bundle-web.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ export const bundledLanguagesInfo: BundledLanguageInfo[] = [
8181
'name': 'HTML',
8282
'import': (() => import('./langs/html')) as DynamicImportLanguageRegistration
8383
},
84+
{
85+
'id': 'html-derivative',
86+
'name': 'HTML (Derivative)',
87+
'import': (() => import('./langs/html-derivative')) as DynamicImportLanguageRegistration
88+
},
8489
{
8590
'id': 'http',
8691
'name': 'HTTP',
@@ -312,7 +317,7 @@ export const bundledLanguagesBase = Object.fromEntries(bundledLanguagesInfo.map(
312317

313318
export const bundledLanguagesAlias = Object.fromEntries(bundledLanguagesInfo.flatMap(i => i.aliases?.map(a => [a, i.import]) || []))
314319

315-
export type BundledLanguage = 'angular-html' | 'angular-ts' | 'astro' | 'bash' | 'blade' | 'c' | 'c++' | 'coffee' | 'coffeescript' | 'cpp' | 'css' | 'glsl' | 'gql' | 'graphql' | 'haml' | 'handlebars' | 'hbs' | 'html' | 'http' | 'imba' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsx' | 'julia' | 'less' | 'lua' | 'markdown' | 'marko' | 'md' | 'mdc' | 'mdx' | 'php' | 'postcss' | 'pug' | 'py' | 'python' | 'r' | 'rb' | 'ruby' | 'sass' | 'scss' | 'sh' | 'shell' | 'shellscript' | 'sql' | 'styl' | 'stylus' | 'svelte' | 'toml' | 'ts' | 'tsx' | 'typescript' | 'vue' | 'vue-html' | 'wasm' | 'wgsl' | 'xml' | 'yaml' | 'yml' | 'zsh'
320+
export type BundledLanguage = 'angular-html' | 'angular-ts' | 'astro' | 'bash' | 'blade' | 'c' | 'c++' | 'coffee' | 'coffeescript' | 'cpp' | 'css' | 'glsl' | 'gql' | 'graphql' | 'haml' | 'handlebars' | 'hbs' | 'html' | 'html-derivative' | 'http' | 'imba' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsx' | 'julia' | 'less' | 'lua' | 'markdown' | 'marko' | 'md' | 'mdc' | 'mdx' | 'php' | 'postcss' | 'pug' | 'py' | 'python' | 'r' | 'rb' | 'ruby' | 'sass' | 'scss' | 'sh' | 'shell' | 'shellscript' | 'sql' | 'styl' | 'stylus' | 'svelte' | 'toml' | 'ts' | 'tsx' | 'typescript' | 'vue' | 'vue-html' | 'wasm' | 'wgsl' | 'xml' | 'yaml' | 'yml' | 'zsh'
316321

317322
export const bundledLanguages = {
318323
...bundledLanguagesBase,

packages/shiki/test/bundle.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ it('bundle-full', async () => {
66
}))
77

88
expect(highlighter.getLoadedLanguages().length)
9-
.toMatchInlineSnapshot(`250`)
9+
.toMatchInlineSnapshot(`251`)
1010
})
1111

1212
it('bundle-web', async () => {
@@ -15,5 +15,5 @@ it('bundle-web', async () => {
1515
}))
1616

1717
expect(highlighter.getLoadedLanguages().length)
18-
.toMatchInlineSnapshot(`79`)
18+
.toMatchInlineSnapshot(`80`)
1919
})

packages/shiki/test/general.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ describe('should', () => {
6161
"gql",
6262
"graphql",
6363
"html",
64+
"html-derivative",
6465
"jade",
6566
"javascript",
6667
"js",

packages/shiki/test/out/injections-side-effects-angular-after.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/shiki/test/out/injections-side-effects-angular-ts-after.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-lock.yaml

+51-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

taze.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ export default defineConfig({
55
'**/vendor/**',
66
'**/node_modules/**',
77
],
8+
exclude: [
9+
'shiki-legacy',
10+
],
811
packageMode: {
912
// The WASM in v2.0 is not compatible with our loader
1013
// As there seems to be no much improvement, I guess we could stick with the old version for a while longer

0 commit comments

Comments
 (0)