Parsing HTML data after making API call


#1

Hi all,

I am trying to get some information from API. When I make the call and pass it to UI the data is being displayed as <p style=“margin-top: 0px; margin-bottom: 15px; line-height: 20px; text-align: justify; font-family: “Open Sans”, sans-serif; background-color: rgb(231, 232, 234);”>Some content over here.

<div class=“clear” style=“clear: both; height: 1px; overflow: hidden; font-family: “Open Sans”, sans-serif; background-color: rgb(231, 232, 234);”><img alt="" src=“spacer.gif” />.

Is there anyway that I can parse this HTML data so it displays the actual content instead of HTML code.


#2

Try HTMLView if you want to retain the styles. If you want to parse plain text, you will get many examples in JavaScript or even there are packages in NPM.