Hi,
Can anyone tell me how to remove all HTML Tags from the summary without having to individually removing each tag?
I’d like to use regular expression - something like:
${s.result.metaData[“c”]!?replace(“<[a-zA-Z/][^>]*>”, “”, "g ")
Collection type - database
The text coming from the DB is rich text and I don’t want to use <#noescape> because truncating will result in
<stron… hence will break the layout due to the closing tag missing.
HTML tags are showing at the fornt-end.
Thank you
N
Unfortunately not possible from the source. I had a look at the docs but is there a chance you could show me an example?
something like:
transaction?.response?.resultPacket?.results.each() {
// In Groovy, "it" represents the item being iterated
if ( it.metaData["c"] != __NULL__ ) {
// how would you do a find and replace?? i.e <h2> </h2> <ul> <li> etc
}
}
I think what you have there is pretty much what you want. You might also need to account for an unclosed tag at the end of the description if it’s been truncated at all when indexing or displaying - either increase the size of the indexed field to ensure it doesn’t get truncated (check the -mdsfml indexer option which sets the max size for the metadata field and possibly the -MBL query processor option which controls the metadata display buffer).
Thanks Peter,
The text coming has a lot of html formatting and is too big to account for all of it. I may need to get our people to incorporate a “summary field” that we can map to with no html and appropriate size for display.