Convert Markdown response to HTML

I am getting the output from API in markdown where it could have nested list data and when I am converting this markdown to html it makes all the (-) in list and do not create nested list if there was my output from API is

so please provide me a js function to convert this md to html