Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys

I saved a string in a rich-text form using quill. Now when i pull my html string from the database it doesn't show like normal text it shows exactly what is saved.

This is the saved string from the database:
HTML
"<H3>Hello</H3>"

When I use that string it still shows as:
HTML
"<H3>Hello</H3>"
NOT "Hello"

What I have tried:

I tried using the
HTML
pre
tags before using the string but no luck
Posted
Updated 17-Jul-18 23:27pm

If you have some kind of control which is able to show formatted text using a specific format, you have to pass the text in that format.

While it is possible to convert from one format to another, some special format options might get lost and the display is often not absolute identical. So it is always better to use a control that is able to show the input format rather than converting.

That means in your case that it is better to either use a HTML edit control to show the HTML text stored in the database or store the text in RTF format in the database.

If that is not possible you have to use an HTML to RTF converter or vice versa.
 
Share this answer
 
Comments
Anele Ngqandu 18-Jul-18 5:28am    
Thank Jochen, I ended up using ng-bind-html
This actually helped me Angular ng-bind-html Directive[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900