How to parse HTML tags information into normal text without using the [code][/code]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 06:35 AM
Hi All,
How to parse HTML tags information into normal text without using the [code][/code].
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 07:36 AM
Hi @sree06 ,
Just for awareness in case the html used is helping in formatting the data (tags like "p" for paragraphs or even "div" or "br" ), the formatting will be lost. If that is the case then you might want to convert some of those tags to text representation before stripping. For example changing out break tags <br /> or ending div "</div>" and paragraph "</p>" tags with "\n".
This way you won't have a bunch of garbled up text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2024 11:10 AM
Would love to see an example of that, @sree06.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 07:56 AM
Hello @sree06,
You can use decodeHTML() functionality in servicenow to convert your HTML information into the Normal Text.
Below I have attached the link for more reference:
https://www.servicenow.com/community/developer-forum/removing-html-tags/m-p/2522727
If my answer helps with your issue, Please mark the answer as Accepted Solution and mark it as Helpful.
Thank you !
Prathamesh
