@shikijs/markdown-it 1.0.0-beta.6 → 1.0.0-rc.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/dist/core.d.mts +0 -7
- package/dist/core.d.ts +0 -7
- package/dist/core.mjs +0 -10
- package/dist/index.mjs +0 -1
- package/package.json +3 -3
package/dist/core.d.mts
CHANGED
|
@@ -2,13 +2,6 @@ import MarkdownIt from 'markdown-it';
|
|
|
2
2
|
import { CodeOptionsThemes, BuiltinTheme, TransformerOptions, CodeOptionsMeta, HighlighterGeneric } from 'shiki';
|
|
3
3
|
|
|
4
4
|
interface MarkdownItShikiExtraOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Add `highlighted` class to lines defined in after codeblock
|
|
7
|
-
*
|
|
8
|
-
* @deprecated Use [transformerNotationHighlight](https://shiki.style/packages/transformers#transformernotationhighlight) instead
|
|
9
|
-
* @default false
|
|
10
|
-
*/
|
|
11
|
-
highlightLines?: boolean | string;
|
|
12
5
|
/**
|
|
13
6
|
* Custom meta string parser
|
|
14
7
|
* Return an object to merge with `meta`
|
package/dist/core.d.ts
CHANGED
|
@@ -2,13 +2,6 @@ import MarkdownIt from 'markdown-it';
|
|
|
2
2
|
import { CodeOptionsThemes, BuiltinTheme, TransformerOptions, CodeOptionsMeta, HighlighterGeneric } from 'shiki';
|
|
3
3
|
|
|
4
4
|
interface MarkdownItShikiExtraOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Add `highlighted` class to lines defined in after codeblock
|
|
7
|
-
*
|
|
8
|
-
* @deprecated Use [transformerNotationHighlight](https://shiki.style/packages/transformers#transformernotationhighlight) instead
|
|
9
|
-
* @default false
|
|
10
|
-
*/
|
|
11
|
-
highlightLines?: boolean | string;
|
|
12
5
|
/**
|
|
13
6
|
* Custom meta string parser
|
|
14
7
|
* Return an object to merge with `meta`
|
package/dist/core.mjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { transformerMetaHighlight } from '@shikijs/transformers';
|
|
2
|
-
|
|
3
1
|
function setupMarkdownIt(markdownit, highlighter, options) {
|
|
4
2
|
const {
|
|
5
|
-
highlightLines = false,
|
|
6
3
|
parseMetaString
|
|
7
4
|
} = options;
|
|
8
5
|
markdownit.options.highlight = (code, lang = "text", attrs) => {
|
|
@@ -17,13 +14,6 @@ function setupMarkdownIt(markdownit, highlighter, options) {
|
|
|
17
14
|
}
|
|
18
15
|
};
|
|
19
16
|
const builtInTransformer = [];
|
|
20
|
-
if (highlightLines) {
|
|
21
|
-
builtInTransformer.push(
|
|
22
|
-
transformerMetaHighlight({
|
|
23
|
-
className: highlightLines === true ? "highlighted" : highlightLines
|
|
24
|
-
})
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
17
|
builtInTransformer.push({
|
|
28
18
|
name: "@shikijs/markdown-it:block-class",
|
|
29
19
|
code(node) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getHighlighter, bundledLanguages } from 'shiki';
|
|
2
2
|
import { setupMarkdownIt } from './core.mjs';
|
|
3
3
|
export { fromHighlighter } from './core.mjs';
|
|
4
|
-
import '@shikijs/transformers';
|
|
5
4
|
|
|
6
5
|
async function markdownItShiki(options) {
|
|
7
6
|
const themeNames = ("themes" in options ? Object.values(options.themes) : [options.theme]).filter(Boolean);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shikijs/markdown-it",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-
|
|
4
|
+
"version": "1.0.0-rc.0",
|
|
5
5
|
"description": "markdown-it integration for shiki",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"markdown-it": "^14.0.0",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
49
|
+
"shiki": "1.0.0-rc.0",
|
|
50
|
+
"@shikijs/transformers": "1.0.0-rc.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/markdown-it": "^13.0.7"
|