0

I am using ckeditor for inserting blog contact in django. When I integrated CKeditor with my django admin then I got API Set, click here to see the screenshots of the data. In image you can see there is sub_title_second given as a html format. I tried to fetch this API as a normal way click here to check the code. But it coming in below format

p style="text-align: center;"><span style="font-size: 24pt;"><strong><span style="font-family: georgia, palatino, serif;">"I never regretted being an architect&rdquo;- Ratan Tata</span></strong></span></p> <p style="text-align: justify;"><span style="font-size: 12pt;"><span style="font-family: georgia, palatino, serif;">Ratan Tata is well known as an industrialist, philanthropist, and former chairman of Tata Sons.</span></span></p>

How can we fetch this as UI format? or Click here to see image

Kwall
  • 549
  • 4
  • 15
  • I think what you looking for is https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml; `

    `. Make sure you are protecting your code from XSS when using this method.
    – Mr T Apr 08 '21 at 12:46
  • @MrT Ok this is working but now the question is How to protect it with XSS? – Kwall Apr 08 '21 at 13:05
  • You are not protecting with XSS, you need to protect _against_ XSS. https://stackoverflow.com/questions/33644499/what-does-it-mean-when-they-say-react-is-xss-protected – Mr T Apr 08 '21 at 13:11
  • 1
    @MrT Now Am very clear with all this topic and everything is set well. Thanks!! – Kwall Apr 08 '21 at 19:09

0 Answers0