@shikijs/markdown-it 3.4.1 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -11,6 +11,11 @@ type MarkdownItShikiOptions = MarkdownItShikiSetupOptions & {
11
11
  * @default Object.keys(bundledLanguages)
12
12
  */
13
13
  langs?: Array<LanguageInput | BuiltinLanguage>;
14
+ /**
15
+ * Alias of languages
16
+ * @example { 'my-lang': 'javascript' }
17
+ */
18
+ langAlias?: Record<string, string>;
14
19
  };
15
20
  declare function markdownItShiki(options: MarkdownItShikiOptions): Promise<(markdownit: MarkdownIt) => void>;
16
21
 
package/dist/index.mjs CHANGED
@@ -1,12 +1,15 @@
1
- import { createHighlighter, bundledLanguages } from 'shiki';
1
+ import { bundledLanguages, createHighlighter } from 'shiki';
2
2
  import { setupMarkdownIt } from './core.mjs';
3
3
  export { fromHighlighter } from './core.mjs';
4
4
 
5
5
  async function markdownItShiki(options) {
6
6
  const themeNames = ("themes" in options ? Object.values(options.themes) : [options.theme]).filter(Boolean);
7
+ const langs = options.langs || Object.keys(bundledLanguages);
8
+ const langAlias = options.langAlias || {};
7
9
  const highlighter = await createHighlighter({
8
10
  themes: themeNames,
9
- langs: options.langs || Object.keys(bundledLanguages)
11
+ langs,
12
+ langAlias
10
13
  });
11
14
  return function(markdownit) {
12
15
  setupMarkdownIt(markdownit, highlighter, options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/markdown-it",
3
3
  "type": "module",
4
- "version": "3.4.1",
4
+ "version": "3.4.2",
5
5
  "description": "markdown-it integration for shiki",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "markdown-it": "^14.1.0",
41
- "shiki": "3.4.1"
41
+ "shiki": "3.4.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/markdown-it": "^14.1.2",
45
45
  "markdown-it-async": "^2.2.0",
46
- "@shikijs/transformers": "3.4.1"
46
+ "@shikijs/transformers": "3.4.2"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "unbuild",