balbant
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017
07:22 AM
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.
Please help us for resolve this issue.
4 REPLIES 4
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2017
12:08 PM
Re: How to displaying text without HTML tags?
If you can run your html string through PHP it's real easy --
https://www.w3schools.com/php/func_stri ... p_tags.asp
https://www.w3schools.com/php/func_stri ... p_tags.asp
Tyler_Smith
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017
04:49 PM
Re: How to displaying text without HTML tags?
From: https://forums.roku.com/viewtopic.php?t=40811
function StringRemoveHTMLTags(baseStr as String) as String
r = createObject("roRegex", "<[^<]+?>", "i")
return r.replaceAll(baseStr, "")
end function
Tyler Smith
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017
06:50 PM
Re: How to displaying text without HTML tags?
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.
<gasp>
But for the cheap man's solution it works.
Tyler_Smith
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017
09:49 PM
Re: How to displaying text without HTML tags?
"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 < or < 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.
Tyler Smith