@astrojs/mdx 3.1.3 → 4.0.0-alpha.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/vite-plugin-mdx.js +3 -2
- package/package.json +7 -9
package/dist/vite-plugin-mdx.js
CHANGED
|
@@ -32,8 +32,9 @@ function vitePluginMdx(mdxOptions) {
|
|
|
32
32
|
// ex. inject layouts
|
|
33
33
|
async transform(code, id) {
|
|
34
34
|
if (!id.endsWith(".mdx")) return;
|
|
35
|
-
const { data: frontmatter, content: pageContent } = parseFrontmatter(code, id);
|
|
36
|
-
const
|
|
35
|
+
const { data: frontmatter, content: pageContent, matter } = parseFrontmatter(code, id);
|
|
36
|
+
const frontmatterLines = matter ? matter.match(/\n/g)?.join("") + "\n\n" : "";
|
|
37
|
+
const vfile = new VFile({ value: frontmatterLines + pageContent, path: id });
|
|
37
38
|
setVfileFrontmatter(vfile, frontmatter);
|
|
38
39
|
if (!processor) {
|
|
39
40
|
return this.error(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/mdx",
|
|
3
3
|
"description": "Add support for MDX pages in your Astro site",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0-alpha.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"acorn": "^8.12.1",
|
|
32
32
|
"es-module-lexer": "^1.5.4",
|
|
33
33
|
"estree-util-visit": "^2.0.0",
|
|
34
|
-
"github-slugger": "^2.0.0",
|
|
35
34
|
"gray-matter": "^4.0.3",
|
|
36
35
|
"hast-util-to-html": "^9.0.1",
|
|
37
36
|
"kleur": "^4.1.5",
|
|
@@ -41,31 +40,30 @@
|
|
|
41
40
|
"source-map": "^0.7.4",
|
|
42
41
|
"unist-util-visit": "^5.0.0",
|
|
43
42
|
"vfile": "^6.0.2",
|
|
44
|
-
"@astrojs/markdown-remark": "
|
|
43
|
+
"@astrojs/markdown-remark": "6.0.0-alpha.0"
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {
|
|
47
|
-
"astro": "^
|
|
46
|
+
"astro": "^5.0.0-alpha.0"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
49
|
"@types/estree": "^1.0.5",
|
|
51
50
|
"@types/hast": "^3.0.4",
|
|
52
51
|
"@types/mdast": "^4.0.4",
|
|
53
|
-
"
|
|
54
|
-
"cheerio": "1.0.0-rc.12",
|
|
52
|
+
"cheerio": "1.0.0",
|
|
55
53
|
"linkedom": "^0.18.4",
|
|
56
54
|
"mdast-util-mdx": "^3.0.0",
|
|
57
55
|
"mdast-util-mdx-jsx": "^3.1.2",
|
|
58
56
|
"mdast-util-to-string": "^4.0.0",
|
|
59
|
-
"reading-time": "^1.5.0",
|
|
60
57
|
"rehype-mathjax": "^6.0.0",
|
|
61
58
|
"rehype-pretty-code": "^0.13.2",
|
|
62
59
|
"remark-math": "^6.0.0",
|
|
63
60
|
"remark-rehype": "^11.1.0",
|
|
64
61
|
"remark-shiki-twoslash": "^3.1.3",
|
|
65
62
|
"remark-toc": "^9.0.0",
|
|
63
|
+
"shiki": "^1.14.1",
|
|
66
64
|
"unified": "^11.0.5",
|
|
67
|
-
"vite": "^5.
|
|
68
|
-
"astro": "
|
|
65
|
+
"vite": "^5.4.1",
|
|
66
|
+
"astro": "5.0.0-alpha.0",
|
|
69
67
|
"astro-scripts": "0.0.14"
|
|
70
68
|
},
|
|
71
69
|
"engines": {
|