From 2c1b4bed81a92228884b604d9a74dfd85ee135b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?= Date: Mon, 14 Nov 2022 15:43:54 +0100 Subject: [PATCH] Add plugin to fix problem with wrapped images For more details see this issue: https://github.com/mdx-js/mdx/issues/1798 --- website/package-lock.json | 27 +++++++++++++++++++++++++++ website/package.json | 1 + website/plugins/index.mjs | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/website/package-lock.json b/website/package-lock.json index dc3c50918..d52131993 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -32,6 +32,7 @@ "remark": "^14.0.2", "remark-gfm": "^3.0.1", "remark-react": "^9.0.1", + "remark-unwrap-images": "^3.0.1", "sass": "^1.56.1", "svg-react-loader": "^0.4.6", "typescript": "4.8.4" @@ -4961,6 +4962,21 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-unwrap-images": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-unwrap-images/-/remark-unwrap-images-3.0.1.tgz", + "integrity": "sha512-5VUY0n+J9lPTPfkct5S3/SbutryBjp8J/4mbgtlkDrOk3h8jde0hyqdYUJOoJKherZezS08tjd6i4+nnQ+wl5w==", + "dependencies": { + "@types/mdast": "^3.0.0", + "hast-util-whitespace": "^2.0.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", @@ -9464,6 +9480,17 @@ "unified": "^10.0.0" } }, + "remark-unwrap-images": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-unwrap-images/-/remark-unwrap-images-3.0.1.tgz", + "integrity": "sha512-5VUY0n+J9lPTPfkct5S3/SbutryBjp8J/4mbgtlkDrOk3h8jde0hyqdYUJOoJKherZezS08tjd6i4+nnQ+wl5w==", + "requires": { + "@types/mdast": "^3.0.0", + "hast-util-whitespace": "^2.0.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0" + } + }, "resolve": { "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", diff --git a/website/package.json b/website/package.json index c728719cc..bddf0ebda 100644 --- a/website/package.json +++ b/website/package.json @@ -34,6 +34,7 @@ "remark": "^14.0.2", "remark-gfm": "^3.0.1", "remark-react": "^9.0.1", + "remark-unwrap-images": "^3.0.1", "sass": "^1.56.1", "svg-react-loader": "^0.4.6", "typescript": "4.8.4" diff --git a/website/plugins/index.mjs b/website/plugins/index.mjs index e18c18711..c08332bcf 100644 --- a/website/plugins/index.mjs +++ b/website/plugins/index.mjs @@ -1,7 +1,8 @@ import remarkGfm from 'remark-gfm' +import remarkUnwrapImages from 'remark-unwrap-images' import remarkCustomAttrs from './remarkCustomAttrs.mjs' -const remarkPlugins = [remarkGfm, remarkCustomAttrs] +const remarkPlugins = [remarkGfm, remarkUnwrapImages, remarkCustomAttrs] export default remarkPlugins