-
|
I’ve already posted this question on Stack Overflow for about a day without a response, so I’m posting it here in hopes of someone understanding how to solve it. I’ve set up MDX with Next.js and I’m able to use it to set up pages. I’m also able to add plugins to remark and rehype through MathJax is being processed on the server side, but I’m seeing problems in my generated HTML markup where <mjx-c className="mjx-c2212"></mjx-c>This issue appears in a Next app, so you can reproduce the issue by using import nextMDX from "@next/mdx";
import remarkMath from "remark-math";
import rehypeMathjaxChtml from "./rehype-mathjax/chtml.js";
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm, remarkMath],
rehypePlugins: [
[
rehypeMathjaxChtml,
{
chtml: {
fontURL:
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/output/chtml/fonts/woff-v2",
},
},
],
],
},
});
const nextConfig = {
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
reactStrictMode: true,
};
export default withMDX(nextConfig);Create a page such as |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
See also remarkjs/remark-math#80. |
Beta Was this translation helpful? Give feedback.
-
|
Hi! If you are running into Next.js hydration mismatches and className issues when using Since early 2023, all major browser engines natively support MathML Core, so you don't need to load heavy JS rendering engines or style sheets on the client side at all. Because the HTML output contains pure static I wrote You can easily integrate it into your Demo: https://math.webc.site |
Beta Was this translation helpful? Give feedback.
See also remarkjs/remark-math#80.