@astrojs/mdx 0.16.2 → 0.17.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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +6 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/test/mdx-plugins.test.js +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
[34m@astrojs/mdx:build: [0mcache hit, replaying output [2m0e77d93ea69c7ebc[0m
|
|
2
|
+
[34m@astrojs/mdx:build: [0m
|
|
3
|
+
[34m@astrojs/mdx:build: [0m> @astrojs/mdx@0.17.0 build /home/runner/work/astro/astro/packages/integrations/mdx
|
|
4
|
+
[34m@astrojs/mdx:build: [0m> astro-scripts build "src/**/*.ts" && tsc
|
|
5
|
+
[34m@astrojs/mdx:build: [0m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @astrojs/mdx
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#6253](https://github.com/withastro/astro/pull/6253) [`0049fda62`](https://github.com/withastro/astro/commit/0049fda62fa8650a0d250adb00a2c5d82679aeaf) Thanks [@bluwy](https://github.com/bluwy)! - Support rehype plugins that inject namespaced attributes. This introduces a breaking change if you use [custom components for HTML elements](https://docs.astro.build/en/guides/markdown-content/#assigning-custom-components-to-html-elements), where the prop passed to the component will be normal HTML casing, e.g. `class` instead of `className`, and `xlink:href` instead of `xlinkHref`.
|
|
8
|
+
|
|
3
9
|
## 0.16.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ function mdx(partialMdxOptions = {}) {
|
|
|
48
48
|
const { data: frontmatter, content: pageContent } = parseFrontmatter(code, id);
|
|
49
49
|
const compiled = await mdxCompile(new VFile({ value: pageContent, path: id }), {
|
|
50
50
|
...mdxPluginOpts,
|
|
51
|
+
elementAttributeNameCase: "html",
|
|
51
52
|
remarkPlugins: [
|
|
52
53
|
toRemarkInitializeAstroData({ userFrontmatter: frontmatter }),
|
|
53
54
|
...mdxPluginOpts.remarkPlugins ?? []
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/mdx",
|
|
3
3
|
"description": "Use MDX within Astro",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.17.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/mdast": "^3.0.10",
|
|
49
49
|
"@types/mocha": "^9.1.1",
|
|
50
50
|
"@types/yargs-parser": "^21.0.0",
|
|
51
|
-
"astro": "2.0.
|
|
51
|
+
"astro": "2.0.13",
|
|
52
52
|
"astro-scripts": "0.0.10",
|
|
53
53
|
"chai": "^4.3.6",
|
|
54
54
|
"cheerio": "^1.0.0-rc.11",
|
package/src/index.ts
CHANGED
|
@@ -74,6 +74,7 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
|
|
|
74
74
|
const { data: frontmatter, content: pageContent } = parseFrontmatter(code, id);
|
|
75
75
|
const compiled = await mdxCompile(new VFile({ value: pageContent, path: id }), {
|
|
76
76
|
...mdxPluginOpts,
|
|
77
|
+
elementAttributeNameCase: 'html',
|
|
77
78
|
remarkPlugins: [
|
|
78
79
|
// Ensure `data.astro` is available to all remark plugins
|
|
79
80
|
toRemarkInitializeAstroData({ userFrontmatter: frontmatter }),
|
package/test/mdx-plugins.test.js
CHANGED
|
@@ -63,7 +63,7 @@ describe('MDX plugins', () => {
|
|
|
63
63
|
expect(selectRehypeExample(document)).to.not.be.null;
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
it
|
|
66
|
+
it('supports custom rehype plugins with namespaced attributes', async () => {
|
|
67
67
|
const fixture = await buildFixture({
|
|
68
68
|
integrations: [
|
|
69
69
|
mdx({
|