hashicorp / next-mdx-remote

Load MDX content from anywhere
Mozilla Public License 2.0
2.6k stars 140 forks source link

Replacing standard markdown elements doesn't work #4

Closed EarthlingDavey closed 4 years ago

EarthlingDavey commented 4 years ago

If I set the components to target standard markdown html elements, like h1, img etc.

e.g.

const components = {
  h1: (props) => <h1 style={{ color: 'tomato' }} {...props} />,
}

Then the static files are correct.

But, on page load in the browser. I think the component assignment is ignored.

With my example I'll see a red h1 for a second then black.

Html source has this in it <h1 style="color:tomato">Games</h1> ... mdx(\"h1\", null, \"Games\"),

Expected behaviour - consistent components across static and in browser.

Thanks - Davey

jescalan commented 4 years ago

Thanks for filing this one, I'll get it on the list to address!

iamturns commented 4 years ago

Hey @jescalan - any ETA on this one? Is it a tricky bug?

revskill10 commented 4 years ago

Maybe related, but i couldn't make syntax highlighting work per mdxjs docs. Could you provide example with syntax highlighting too ?