1

I have ![Alt text](/RSA1.jpg ) in my markdown file. When I read the markdown file and render it is showing the alt text instead of image and when i inspect there is this line as below as below:

<img alt="Alt text" src="/RSA1.jpg">

How can I render image??? I am using markdown to jsx as markdown parser.

3 Answers 3

1

Markdown for the component era MDX is an authorable format that lets you seamlessly write JSX in your Markdown documents. You can import components, such as interactive charts or alerts, and embed them within your content. This makes writing long-form content with components a blast

https://mdxjs.com/getting-started/

Sign up to request clarification or add additional context in comments.

Comments

1

Make sure RSA1.jpg is in your public folder, and it should render the image properly. The markdown parser can't find images unless they're in the public folder.

Comments

0

watch this video it might help to fix the image URI to load the image correctly: https://youtu.be/LIrK5KxsUSE?t=351

This is the solution:

 <Reactmarkdown source={data.strapiArticle.content} transformImageUri={uri =>
uri.startsWith("http") ? uri : `${process.env.REACT_IMAGE_BASE_URL}${uri}` />

.env.development file:

REACT_IMAGE_BASE_URL =http://localhost:1337

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.