We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
^9.0.0
No response
import Markdown from 'react-markdown'; import rehypeRaw from 'rehype-raw'; import rehypeKatex from 'rehype-katex'; import remarkMath from 'remark-math'; import 'property-information'; const preprocessLaTeX = (content) => { const blockProcessedContent = content.replace( /\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`, ); const inlineProcessedContent = blockProcessedContent.replace( /\\\((.*?)\\\)/gs, (_, equation) => `$${equation}$`, ); return inlineProcessedContent; }; return ( <> {text && text.length > 0 && text.map((message, index) => ( <div key={index} className="markdown" id="bot-msg"> <Markdown remarkPlugins={[remarkMath]} rehypePlugins={[rehypeRaw, rehypeKatex]} components={{ img: ({node, ...props}) => <img style={{maxWidth: '100%'}} {...props} /> }} > {preprocessLaTeX(message)} </Markdown> </div> )) } </> )
When the text value is
! [Image 1] (image url) ! [Image 2] (image url)
This code was working till few days back. Without making any changes in the code, the functionality is not working for image rendering.
I am using Parcel as the bundler for my react web app
Should render appropriate image using image tags and the href attribute of img tag set to the image url
Rendering plain text. Not rendering appropriate img tags
npm 8
Windows
Parcel
The text was updated successfully, but these errors were encountered:
Welcome @agrajgarg! 👋 Nothing has changed in react-markdown recently.
react-markdown
A few things which come to mind.
!
[
]
(
()
[]
This doesn't appear to be a bug in react-markdown, you're welcome to ask follow up question in https://github.com/orgs/remarkjs/discussions, I'd recommend including a minimal reproducible example based off https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/react-markdown-with-vite
Sorry, something went wrong.
No branches or pull requests
Initial checklist
Affected packages and versions
^9.0.0
Link to runnable example
No response
Steps to reproduce
When the text value is
This code was working till few days back. Without making any changes in the code, the functionality is not working for image rendering.
I am using Parcel as the bundler for my react web app
Expected behavior
Should render appropriate image using image tags and the href attribute of img tag set to the image url
Actual behavior
Rendering plain text. Not rendering appropriate img tags
Runtime
No response
Package manager
npm 8
OS
Windows
Build and bundle tools
Parcel
The text was updated successfully, but these errors were encountered: