Currently, to register a new language you can use this step:
shiki.getHighlighter({
theme: 'nord',
langs:[
{
id: 'blade',
scopeName: 'text.html.php.blade',
path: 'languages/blade.tmLanguage.json', //<------------------------------------
aliases: ['blade']
}
]
})
However, shiki forces the path to relative to the unpkg v0.11.1 cdn. What if I wanted to get a language grammar from my local file, or another cdn, or a lower version ?
shiki.getHighlighter({
theme: 'nord',
langs:[
{
id: 'blade',
scopeName: 'text.html.php.blade',
path: '/js/dist/languages/blade.tmLanguage.json', //<------------------------------------ this goes to `[unpk](https://unpkg.com/[email protected]//js/shiki/languages/blade.tmLanguage.json` rather than my local file
aliases: ['blade']
}
]
})
EDIT: After digging through the code, i found that I could use this:
shiki.setCDN('https://unpkg.com/browse/[email protected]/')
shiki.getHighlighter({
theme: 'nord',
langs:[
........
However, I get this error:
Uncaught (in promise) CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
Btw, if you're wondering why I'm trying to manually set the CDN, it's because Shiki versions above 0.10.1 have a bug when using the CDN. So, I am using 0.10.1, but the blade grammar is only available on unpkg shiki version 0.11.1
Currently, to register a new language you can use this step:
However, shiki forces the path to relative to the unpkg v0.11.1 cdn. What if I wanted to get a language grammar from my local file, or another cdn, or a lower version ?
EDIT: After digging through the code, i found that I could use this:
However, I get this error:
Btw, if you're wondering why I'm trying to manually set the CDN, it's because Shiki versions above
0.10.1have a bug when using the CDN. So, I am using0.10.1, but the blade grammar is only available on unpkg shiki version 0.11.1