@astrojs/markdown-remark 2.1.4 → 2.2.1
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/remark-shiki.js +17 -0
- package/package.json +7 -4
- package/.turbo/turbo-build.log +0 -5
- package/CHANGELOG.md +0 -821
- package/src/frontmatter-injection.ts +0 -41
- package/src/index.ts +0 -170
- package/src/internal.ts +0 -5
- package/src/load-plugins.ts +0 -42
- package/src/rehype-collect-headings.ts +0 -129
- package/src/rehype-images.ts +0 -19
- package/src/remark-collect-images.ts +0 -30
- package/src/remark-prism.ts +0 -32
- package/src/remark-scoped-styles.ts +0 -18
- package/src/remark-shiki.ts +0 -106
- package/src/types.ts +0 -96
- package/test/autolinking.test.js +0 -43
- package/test/entities.test.js +0 -14
- package/test/plugins.test.js +0 -28
- package/test/test-utils.js +0 -3
- package/tsconfig.json +0 -10
package/dist/remark-shiki.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import { getHighlighter } from "shiki";
|
|
2
2
|
import { visit } from "unist-util-visit";
|
|
3
3
|
const highlighterCacheAsync = /* @__PURE__ */ new Map();
|
|
4
|
+
const compatThemes = {
|
|
5
|
+
"material-darker": "material-theme-darker",
|
|
6
|
+
"material-default": "material-theme",
|
|
7
|
+
"material-lighter": "material-theme-lighter",
|
|
8
|
+
"material-ocean": "material-theme-ocean",
|
|
9
|
+
"material-palenight": "material-theme-palenight"
|
|
10
|
+
};
|
|
11
|
+
const normalizeTheme = (theme) => {
|
|
12
|
+
if (typeof theme === "string") {
|
|
13
|
+
return compatThemes[theme] || theme;
|
|
14
|
+
} else if (compatThemes[theme.name]) {
|
|
15
|
+
return { ...theme, name: compatThemes[theme.name] };
|
|
16
|
+
} else {
|
|
17
|
+
return theme;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
4
20
|
const remarkShiki = async ({ langs = [], theme = "github-dark", wrap = false }, scopedClassName) => {
|
|
21
|
+
theme = normalizeTheme(theme);
|
|
5
22
|
const cacheID = typeof theme === "string" ? theme : theme.name;
|
|
6
23
|
let highlighterAsync = highlighterCacheAsync.get(cacheID);
|
|
7
24
|
if (!highlighterAsync) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/markdown-remark",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "withastro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
".": "./dist/index.js",
|
|
17
17
|
"./dist/internal.js": "./dist/internal.js"
|
|
18
18
|
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
19
22
|
"peerDependencies": {
|
|
20
|
-
"astro": "^2.
|
|
23
|
+
"astro": "^2.5.0"
|
|
21
24
|
},
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"@astrojs/prism": "^2.1.
|
|
26
|
+
"@astrojs/prism": "^2.1.2",
|
|
24
27
|
"github-slugger": "^1.4.0",
|
|
25
28
|
"import-meta-resolve": "^2.1.0",
|
|
26
29
|
"rehype-raw": "^6.1.1",
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
"remark-parse": "^10.0.1",
|
|
30
33
|
"remark-rehype": "^10.1.0",
|
|
31
34
|
"remark-smartypants": "^2.0.0",
|
|
32
|
-
"shiki": "^0.
|
|
35
|
+
"shiki": "^0.14.1",
|
|
33
36
|
"unified": "^10.1.2",
|
|
34
37
|
"unist-util-visit": "^4.1.0",
|
|
35
38
|
"vfile": "^5.3.2"
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
[35m@astrojs/markdown-remark:build: [0mcache hit, replaying output [2m8b8e166000163d0b[0m
|
|
2
|
-
[35m@astrojs/markdown-remark:build: [0m
|
|
3
|
-
[35m@astrojs/markdown-remark:build: [0m> @astrojs/markdown-remark@2.1.4 build /home/runner/work/astro/astro/packages/markdown/remark
|
|
4
|
-
[35m@astrojs/markdown-remark:build: [0m> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json
|
|
5
|
-
[35m@astrojs/markdown-remark:build: [0m
|