1

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 table: enter image description here

Snap of html output:

enter image description here

1 Answer 1

2

You can use dangerouslySetInnerHTML to render html content.

<div dangerouslySetInnerHTML={{__html: "<p>your html content</p>"}}></div>

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

2 Comments

@DhruvRaval Can you please check it now. I have missed one {}
@DhruvRaval My bad! Didn't noticed the edit notification while editing.

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.