-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-plugin-mdx never parse inlineMath
or math
block into MdxAst
#34305
Comments
inlineMath
or math
block into MdxAstinlineMath
or math
block into MdxAst
Workaround for youDowngrade - "remark-math": "^5.1.1",
+ "remark-math": "^3.0.1",
Why ?
"gatsby-plugin-mdx": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/gatsby-plugin-mdx/-/gatsby-plugin-mdx-3.4.0.tgz",
"integrity": "sha512-SJTIZsQ9lhjkd9GX1v4o1kzYPlu5LTWydHNdpddsP4w9U+dBLcKGXm4ee1PHWpwNL1Y8PeOhRQBUGhbLAbeXTA==",
"requires": {
"@babel/core": "^7.15.5",
"@babel/generator": "^7.15.4",
"@babel/helper-plugin-utils": "^7.14.0",
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
"@babel/preset-env": "^7.15.4",
"@babel/preset-react": "^7.14.0",
"@babel/runtime": "^7.15.4",
"@babel/types": "^7.15.4",
"camelcase-css": "^2.0.1",
"change-case": "^3.1.0",
"core-js": "^3.17.2",
"dataloader": "^1.4.0",
"debug": "^4.3.1",
"escape-string-regexp": "^1.0.5",
"eval": "^0.1.4",
"fs-extra": "^10.0.0",
"gatsby-core-utils": "^3.4.0",
"gray-matter": "^4.0.2",
"json5": "^2.1.3",
"loader-utils": "^1.4.0",
"lodash": "^4.17.21",
"mdast-util-to-string": "^1.1.0",
"mdast-util-toc": "^3.1.0",
"mime": "^2.4.6",
"mkdirp": "^1.0.4",
"p-queue": "^6.6.2",
"pretty-bytes": "^5.3.0",
"remark": "^10.0.1", // ❗❗❗❗ look here❗❗❗❗
"remark-retext": "^3.1.3",
"retext-english": "^3.0.4",
"slugify": "^1.4.4",
"static-site-generator-webpack-plugin": "^3.4.2",
"style-to-object": "^0.3.0",
"underscore.string": "^3.3.5",
"unified": "^8.4.2",
"unist-util-map": "^1.0.5",
"unist-util-remove": "^1.0.3",
"unist-util-visit": "^1.4.1"
},
https://github.com/remarkjs/remark-math/releases/tag/4.0.0
So |
@cangSDARM Why close this issue ? This is still a problem for gatsby user, we need fix it. |
There are many issues mentioned because of this dependency version. Although the problem is presented in a different way. @iChenLei |
After a lot of frustration I found a workaround. The source article is in Japanese, but the steps are easy to follow.
|
Preliminary Checks
Description
My English may be broken. Sorry, I hope there wasn't any missunderstanding.
The ast:
http://localhost:8000/___graphql?query=query%20MyQuery%20%7B%0A%20%20allMdx(filter%3A%20%7Bfields%3A%20%7BtemplateTag%3A%20%7Bin%3A%20%22math%22%7D%7D%7D)%20%7B%0A%20%20%20%20edges%20%7B%0A%20%20%20%20%20%20node%20%7B%0A%20%20%20%20%20%20%20%20mdxAST%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&operationName=MyQuery
The configs:
https://github.com/cangSDARM/blog/blob/master/gatsby-config.js#L29
I tried to use
gatsby-plugin-katex
orremark-html-katex
, all requiredinlineMath
andmath
block in AST, when neither of them exist.Reproduction Link
https://github.com/cangSDARM/blog
Steps to Reproduce
Expected Result
render
inlineMath
ormath
blockthere should be
and
rendered
Actual Result
all rendered as a raw text
Environment
Config Flags
none
The text was updated successfully, but these errors were encountered: