Forum Discussion

balbant's avatar
balbant
Streaming Star
9 years ago

How to displaying text without HTML tags?

We get the content in HTML format. We are want to displaying text without HTML tags in roku scene graph. We don't know how to strip all HTML tags?
Please help us for resolve this issue.

3 Replies

  • destruk's avatar
    destruk
    Streaming Star
    One issue with doing that is that it will match anything between less than and greater than signs - not necessarily a valid html tag.
    <gasp>
    But for the cheap man's solution it works.
  • "destruk" wrote:
    One issue with doing that is that it will match anything between less than and greater than signs - not necessarily a valid html tag.
    <gasp>
    But for the cheap man's solution it works.

    If the source is valid HTML, the greater than and less than signs would be &lt; or &#60; HTML entities, not < or >.
    Your solution is either recommending the developer proxy the html through PHP to strip the HTML or modify the original output, which I doubt they would prefer.