Add plugin to fix problem with wrapped images

For more details see this issue: https://github.com/mdx-js/mdx/issues/1798
This commit is contained in:
Marcus Blättermann 2022-11-14 15:43:54 +01:00
parent 2d12e13f32
commit 66f7bd5d5c
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D
3 changed files with 30 additions and 0 deletions

View File

@ -22,6 +22,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",
"remark-unwrap-images": "^3.0.1",
"sass": "^1.56.1", "sass": "^1.56.1",
"typescript": "4.8.4", "typescript": "4.8.4",
"unist-util-visit": "^4.1.1" "unist-util-visit": "^4.1.1"
@ -4368,6 +4369,21 @@
"url": "https://opencollective.com/unified" "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": { "node_modules/resolve": {
"version": "1.22.1", "version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
@ -8392,6 +8408,17 @@
"unified": "^10.0.0" "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": { "resolve": {
"version": "1.22.1", "version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",

View File

@ -24,6 +24,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"remark-gfm": "^3.0.1", "remark-gfm": "^3.0.1",
"remark-unwrap-images": "^3.0.1",
"sass": "^1.56.1", "sass": "^1.56.1",
"typescript": "4.8.4", "typescript": "4.8.4",
"unist-util-visit": "^4.1.1" "unist-util-visit": "^4.1.1"

View File

@ -1,10 +1,12 @@
import remarkGfm from 'remark-gfm' import remarkGfm from 'remark-gfm'
import remarkUnwrapImages from 'remark-unwrap-images'
import remarkCustomAttrs from './remarkCustomAttrs.mjs' import remarkCustomAttrs from './remarkCustomAttrs.mjs'
import remarkWrapSections from './remarkWrapSections.mjs' import remarkWrapSections from './remarkWrapSections.mjs'
const remarkPlugins = [ const remarkPlugins = [
remarkGfm, remarkGfm,
remarkUnwrapImages,
remarkCustomAttrs, remarkCustomAttrs,
remarkWrapSections, remarkWrapSections,
] ]