React-How to use showdown/markdown?

1k Views Asked by At

In my reactJS project, i have a form to enter name and description.After submitting it should display as a list.What i have to implement is description should be displayed correctly. Inorder to that i have tried showdown(https://github.com/showdownjs/showdown). In server side i did the configuration as it is mentioned in the doc.

   import showdown from "showdown";

   let converter = new showdown.Converter(),
    html = "",
    flag = false;
    for (let i = 0; i < result.data.length; i++) {
    html = converter.makeHtml(result.data[i].description); //this description field i want to showdown
    }

The output i have got is:

  <p>description</p>

But what i have actually need is:

a. abc: 
   i) abc,  
   ii) abc, 
   iii) abc, 
   iv) abc

How do i achieve this?Any help?

0

There are 0 best solutions below