Reputation: 1583
I am building blogging application. and i use summernote for write a blog content. Blog content are stored in database like this :
<b>hi</b>.....<b>share if you like</b>
But when i fetch and try to disply blog content it will display same html code ex:
<b>hi</b>.....<b>share if you like</b>
insted of hi ..... share if you like.
Now how to display blog content with all styles?
Snap of html output:
Upvotes: 1
Views: 201
Reputation: 3109
You can use dangerouslySetInnerHTML
to render html content.
<div dangerouslySetInnerHTML={{__html: "<p>your html content</p>"}}></div>
Upvotes: 2