Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@expressive-code/plugin-shiki

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expressive-code/plugin-shiki - npm Package Compare versions

Comparing version 0.33.3 to 0.33.4

28

dist/index.js

@@ -41,21 +41,13 @@ // src/index.ts

async function ensureLanguageIsLoaded(highlighter, language) {
const loadedLanguages = new Set(highlighter.getLoadedLanguages());
const isLoaded = loadedLanguages.has(language);
const isSpecial = isSpecialLang(language);
const isBundled = Object.keys(bundledLanguages).includes(language);
const isAvailable = isLoaded || isSpecial || isBundled;
if (!isAvailable)
return "txt";
if (isLoaded || isSpecial)
return language;
const loadedLanguage = await memoizeHighlighterTask(highlighter, `loadLanguage:${language}`, async () => {
const loadedLanguages = new Set(highlighter.getLoadedLanguages());
const isLoaded = loadedLanguages.has(language);
const isSpecial = isSpecialLang(language);
const isBundled = Object.keys(bundledLanguages).includes(language);
const isAvailable = isLoaded || isSpecial || isBundled;
if (!isAvailable)
return "txt";
const langsToLoad = [];
if (["md", "markdown", "mdx"].includes(language)) {
const bundledLang = (await bundledLanguages[language]()).default;
const embeddedLangsLazy = [...new Set(bundledLang.flatMap((lang) => lang.embeddedLangsLazy ?? []))];
const missingEmbeddedLangs = embeddedLangsLazy.filter((lang) => !loadedLanguages.has(lang));
langsToLoad.push(...missingEmbeddedLangs);
}
if (!isLoaded && !isSpecial)
langsToLoad.push(language);
if (langsToLoad.length)
await highlighter.loadLanguage(...langsToLoad);
await highlighter.loadLanguage(language);
return language;

@@ -62,0 +54,0 @@ });

{
"name": "@expressive-code/plugin-shiki",
"version": "0.33.3",
"version": "0.33.4",
"description": "Shiki syntax highlighting plugin for Expressive Code, a text marking & annotation engine for presenting source code on the web.",

@@ -26,3 +26,3 @@ "keywords": [],

"dependencies": {
"@expressive-code/core": "^0.33.3",
"@expressive-code/core": "^0.33.4",
"shiki": "^1.1.7"

@@ -29,0 +29,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc