@shikijs/markdown-it 2.4.2 → 3.0.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/markdown-it",
3
3
  "type": "module",
4
- "version": "2.4.2",
4
+ "version": "3.0.0",
5
5
  "description": "markdown-it integration for shiki",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -18,36 +18,13 @@
18
18
  ],
19
19
  "sideEffects": false,
20
20
  "exports": {
21
- ".": {
22
- "types": "./dist/index.d.mts",
23
- "default": "./dist/index.mjs"
24
- },
25
- "./core": {
26
- "types": "./dist/core.d.mts",
27
- "default": "./dist/core.mjs"
28
- },
29
- "./async": {
30
- "types": "./dist/async.d.mts",
31
- "default": "./dist/async.mjs"
32
- }
21
+ ".": "./dist/index.mjs",
22
+ "./core": "./dist/core.mjs",
23
+ "./async": "./dist/async.mjs"
33
24
  },
34
25
  "main": "./dist/index.mjs",
35
26
  "module": "./dist/index.mjs",
36
27
  "types": "./dist/index.d.mts",
37
- "typesVersions": {
38
- "*": {
39
- "core": [
40
- "./dist/core.d.mts"
41
- ],
42
- "async": [
43
- "./dist/async.d.mts"
44
- ],
45
- "*": [
46
- "./dist/*",
47
- "./*"
48
- ]
49
- }
50
- },
51
28
  "files": [
52
29
  "dist"
53
30
  ],
@@ -61,12 +38,12 @@
61
38
  },
62
39
  "dependencies": {
63
40
  "markdown-it": "^14.1.0",
64
- "shiki": "2.4.2"
41
+ "shiki": "3.0.0"
65
42
  },
66
43
  "devDependencies": {
67
44
  "@types/markdown-it": "^14.1.2",
68
45
  "markdown-it-async": "^2.0.0",
69
- "@shikijs/transformers": "2.4.2"
46
+ "@shikijs/transformers": "3.0.0"
70
47
  },
71
48
  "scripts": {
72
49
  "build": "unbuild",
package/dist/async.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import { MarkdownItAsync } from 'markdown-it-async';
2
- import { CodeToHastOptions } from 'shiki';
3
- import { M as MarkdownItShikiSetupOptions } from './shared/markdown-it.DGIVodq2.js';
4
- export { a as MarkdownItShikiExtraOptions } from './shared/markdown-it.DGIVodq2.js';
5
-
6
- declare function setupMarkdownWithCodeToHtml(markdownit: MarkdownItAsync, codeToHtml: (code: string, options: CodeToHastOptions<any, any>) => Promise<string>, options: MarkdownItShikiSetupOptions): void;
7
- /**
8
- * Create a markdown-it-async plugin from a codeToHtml function.
9
- *
10
- * This plugin requires to be installed against a markdown-it-async instance.
11
- */
12
- declare function fromAsyncCodeToHtml(codeToHtml: (code: string, options: CodeToHastOptions<any, any>) => Promise<string>, options: MarkdownItShikiSetupOptions): (markdownit: MarkdownItAsync) => Promise<void>;
13
-
14
- export { MarkdownItShikiSetupOptions, fromAsyncCodeToHtml, setupMarkdownWithCodeToHtml };
package/dist/core.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import MarkdownIt from 'markdown-it';
2
- import { HighlighterGeneric } from 'shiki';
3
- import { M as MarkdownItShikiSetupOptions } from './shared/markdown-it.DGIVodq2.js';
4
- export { a as MarkdownItShikiExtraOptions } from './shared/markdown-it.DGIVodq2.js';
5
-
6
- declare function setupMarkdownIt(markdownit: MarkdownIt, highlighter: HighlighterGeneric<any, any>, options: MarkdownItShikiSetupOptions): void;
7
- declare function fromHighlighter(highlighter: HighlighterGeneric<any, any>, options: MarkdownItShikiSetupOptions): (markdownit: MarkdownIt) => void;
8
-
9
- export { MarkdownItShikiSetupOptions, fromHighlighter, setupMarkdownIt };
package/dist/index.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import MarkdownIt from 'markdown-it';
2
- import { LanguageInput, BuiltinLanguage } from 'shiki';
3
- import { M as MarkdownItShikiSetupOptions } from './shared/markdown-it.DGIVodq2.js';
4
- export { a as MarkdownItShikiExtraOptions } from './shared/markdown-it.DGIVodq2.js';
5
- export { fromHighlighter, setupMarkdownIt } from './core.js';
6
-
7
- type MarkdownItShikiOptions = MarkdownItShikiSetupOptions & {
8
- /**
9
- * Language names to include.
10
- *
11
- * @default Object.keys(bundledLanguages)
12
- */
13
- langs?: Array<LanguageInput | BuiltinLanguage>;
14
- };
15
- declare function markdownItShiki(options: MarkdownItShikiOptions): Promise<(markdownit: MarkdownIt) => void>;
16
-
17
- export { type MarkdownItShikiOptions, MarkdownItShikiSetupOptions, markdownItShiki as default };
@@ -1,31 +0,0 @@
1
- import { CodeOptionsThemes, BuiltinTheme, TransformerOptions, CodeOptionsMeta, LanguageInput, BuiltinLanguage } from 'shiki';
2
-
3
- interface MarkdownItShikiExtraOptions {
4
- /**
5
- * Custom meta string parser
6
- * Return an object to merge with `meta`
7
- */
8
- parseMetaString?: (metaString: string, code: string, lang: string) => Record<string, any> | undefined | null;
9
- /**
10
- * markdown-it's highlight function will add a trailing newline to the code.
11
- *
12
- * This integration removes the trailing newline to the code by default,
13
- * you can turn this off by passing false.
14
- *
15
- * @default true
16
- */
17
- trimEndingNewline?: boolean;
18
- /**
19
- * When lang of code block is empty string, it will work.
20
- *
21
- * @default 'text'
22
- */
23
- defaultLanguage?: LanguageInput | BuiltinLanguage;
24
- /**
25
- * When lang of code block is not included in langs of options, it will be as a fallback lang.
26
- */
27
- fallbackLanguage?: LanguageInput | BuiltinLanguage;
28
- }
29
- type MarkdownItShikiSetupOptions = CodeOptionsThemes<BuiltinTheme> & TransformerOptions & CodeOptionsMeta & MarkdownItShikiExtraOptions;
30
-
31
- export type { MarkdownItShikiSetupOptions as M, MarkdownItShikiExtraOptions as a };