Questions tagged [react-markdown]
86 questions
1
vote
0 answers
Error when using Partial in nextjs with TypeScript
I'm trying to develop a blog application using Next.js. In this app, there is a component that takes a markdown file and renders its content as a blog page.
import ReactMarkdown from 'react-markdown';
import { NormalComponents, SpecialComponents }…

Pavindu
- 2,684
- 6
- 44
- 77
1
vote
0 answers
_0 is not a function error when push to production
My website works in localhost, but with netlify and vercel it doesn't work. I have managed to track down the error, and it seems to be with react markdown. If I remove the code, my website pushes successfully to netlify and vercel. Here is the code…

ES Sinc
- 61
- 5
1
vote
1 answer
Highlight.js not working with react-markdown
I am using react-syntax-highlighter@15.4.3 for syntax highlighting. Below is the code:
import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import {…

Gratis Devs
- 155
- 9
1
vote
1 answer
Parse subscript in markdown with react-markdown
I wrote this syntax to get subscript in an .md file:
x_i
x~i~
react-markdown did not parse this as a subscript. I found the package remark-sub-super and this plugin as follows:

Yilmaz
- 35,338
- 10
- 157
- 202
1
vote
1 answer
Trying to render a markdown file with images in react
Im trying to render a Markdown file in my react app.
Im using the react-markdown library and converting the MD to text using the following:
useEffect(() => {
fetch(markdownfile).then((response) => response.text()).then((text) => {
…

user15382008
- 11
- 1
1
vote
1 answer
react-markdown and renderers with arguments
I am using React Markdown (https://www.npmjs.com/package/react-markdown) to render markdown content in my NextJS project.
I have created a simple component named "ImageRenderer" and I need to pass an argument (in this case the slug) in addition…

thetiti
- 95
- 2
- 7
1
vote
1 answer
React markdown - how to get nth-element and append another element using react-markdown or dangerouslySetInnerHTML?
I'm looking to append a button after the 2nd paragraph in a react html markdown implementation. I am currently using react-markdown to compile my html code. A few things I am trying to do here:
Get nth element of the react markdown html (ex:…

Invisible-coder
- 149
- 1
- 3
- 12
0
votes
1 answer
In ReactMarkdown, how can I handle custom tags e.g. {{car:audi:q7}}
How can I support custom tags in ReactMarkdown that starts with {{ and ends with }}
e.g.
This is my favorite car {{cars:audi:q7}} this year.
to
This is my favorite car

Tawani Anyangwe
- 9
- 1
0
votes
0 answers
Using custom markdown syntax with react-markdown
I want to use custom syntax in my markdown files, and parse that into some particular HTML when I pass it to my ReactMarkdown component. For instance, if I have something like #custom-marker Text in my markdown file, I'd like to be able to render…

Anya
- 23
- 5
0
votes
0 answers
React markdown not getting displayed correctly using marked-react
I want to display markdown content . When i use a third party website . I get the below image as the markdown response
markdown content on website
I m using marked-react (https://www.npmjs.com/package/marked-react) to display the markdown below is…

Aditya Vernekar
- 1
- 1
0
votes
1 answer
How to add new element inside react-markdown content in nextjs without using jsx?
I use react-markdown to build the virtual dom which allows for updating only the changing DOM instead of completely overwriting. It generate the content in tag. I want to add tag inside tag.

Mai Trung Kiên
- 11
- 3
0
votes
1 answer
ReactDom.render is returning different type than what I need, how to address it?
Markdown rendering is the primary focus. In addition I need to parse the html which is passed as string as well.
You can assume, children is a html passed as string
and isParseRequired is passed as true
import cx from 'classnames'
import…

ishandutta2007
- 16,676
- 16
- 93
- 129
0
votes
1 answer
ReactMarkdown SyntaxHighlighter not working with streamed string
I am getting data as stream which i pass to ReactMarkdown but somehow it syntax highlight doesnot work. however the same string when completed i pass to ReactMarkdown it is working as expected.
its seems that i cannot parse partially streamed string…

Muhammad Sami
- 520
- 2
- 8
- 21
0
votes
0 answers
Incorrect nested ordered list on Firefox with valid HTML
I have a nested ordered list being rendered from Markdown using react-markdown. The list is numbered correctly in Chrome but not in Firefox. It has the following HTML structure:
- Item 1
- Item 2
- Item 3
- …

cpascua
- 1
- 1
0
votes
0 answers
Using Markdown, in React, to render the output of a JSON API
I'm trying to use Markdown to render the output of a Json API, in the chat conversation of this GitHub project: https://github.com/doingthisalright/chatgpt-langchain-qna-on-your-docs
But I can't make it fully work: e.g. the bullet and numbered lists…

Calogero Cascio
- 21
- 2