- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2016 07:24 AM
For CMS, trying to display all knowledge articles in a single page. So, creating a new page from scratch using jelly. I want to display two lines of the articles text for each knowledge article. How to extract the text only from the html text field? where can I find the script?
Right now it is like this,
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 03:49 PM
Hi Rajini,
htmlText.stripScripts().stripTags(); is not working on <hr/> and <br/> but working on <hr> so I guess yes. let us use the regular expression as well. it will work.
function removeHTMLTagsCMS(inputId, divId){
var htmlText = $(inputId).getValue();
htmlText = htmlText.stripScripts().stripTags(); // prototype methods to strip tags and strip scripts
htmlText=htmlText.replace(/<(?:.|\s)*?>/g, " ");
$(divId).update(htmlText) ;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 03:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 03:49 PM
Hi Rajini,
htmlText.stripScripts().stripTags(); is not working on <hr/> and <br/> but working on <hr> so I guess yes. let us use the regular expression as well. it will work.
function removeHTMLTagsCMS(inputId, divId){
var htmlText = $(inputId).getValue();
htmlText = htmlText.stripScripts().stripTags(); // prototype methods to strip tags and strip scripts
htmlText=htmlText.replace(/<(?:.|\s)*?>/g, " ");
$(divId).update(htmlText) ;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 07:01 AM
Yes. We need that
Thanks a lot Venkat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 07:12 AM
Great. Hope the issue is completely resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 07:16 AM