Is there the way to convert remark nodes to amp components? #1898
-
I try to make the SSG site with AMP and Next.js. I want to convert remark node (e.g., image, math) to amp components (e.g., amp-img, amp-mathml) with custom remark extensions. I tried to convert the remark node to const newNode = {
type: "mdxJsxFlowElement",
name: "amp-mathml",
attributes: [
{type: "mdxJsxAttribute", name: "data-formula", value: `[${node.value}]`}
]
} But compile successed with following MDX
So is there a way to convert remark nodes to amp components? and how? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Yes, you can turn mdast into several things, which includes finally getting AMP out. Your question does not have enough information. Follow Support |
Beta Was this translation helpful? Give feedback.
Yes, you can turn mdast into several things, which includes finally getting AMP out.
Your question does not have enough information. Follow Support