I'm grabbing text from a web page, and this often includes HTML entities, as in this string: "In this second chapter of Ayumi’s biography".
I could simply set the HTMLtext of a field to the grabbed text, but it also contains stuff I want to keep, such as img tags. I could simply run it through a few 'replace' steps, but is there a neater method?
HTML entity decoding
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
HTML entity decoding
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: HTML entity decoding
The htmltext isn't lost when it's displayed in a field, so I think I'd just do that because it's the easiest way to translate all the entities. Then when you want to find a particular tag, you can "get the htmltext of fld 1" and use offset or wordoffset to find the tag you're looking for. If you need to collect all the tags of a particular type, include the "skip" parameter in the offset function. That will let you hop through the htmltext very quickly, collecting all the instances as you go.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com