Skip to content

escapeHtml does't work properly in react-markdown #576

Answered by ChristianMurphy
meizibupt asked this question in Q&A
Discussion options

You must be logged in to vote

looks like escapeHtml is enabled by default. If my input has special character in the input string, it renders the special character instead of rending the original string.
"This is euro & #8364;", when it renders, it renders "This is euro €"

That's because it isn't HTML specific, that is how markdown works
https://spec.commonmark.org/dingus/?text=%26%238364%3B%0A
and also why you had to add a space in GitHub, because GitHub flavored markdown builds on CommonMark.

It sounds like what you are really after is an inline code block

This is euro `€`

or an escape character

This is euro \€

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@meizibupt
Comment options

@ChristianMurphy
Comment options

@meizibupt
Comment options

@ChristianMurphy
Comment options

@wooorm
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants