Forum Discussion
Here is a problem:
What if I want to limit the subject title to 50 characters, and in the subject title, there happen to have html entities like < & ™ "
When you truncate the string, you may accidentally cut html entities in half, eg. "&am"
What is the freemarker function to use to convert html entities into normal text? From the rest api, they all return subject title as html, eg: "2 > 1" is actually "2 > 1" in the rest api response.
${utils.html.stripper.from.gdata.strip("<p>hello <b>world</b><strong>!</strong>")}
The above freemarker snippet works.
Do we have any docs of the full utils object?
- peterlu12 years agoChampion
I found a work-around. eg. subject title char limit = 50.
After truncation, I can do another check by using string?last_index_of to locate the &
If & is too close to the end of the truncated string, then do another substring to remove anything from & to the end.
Related Content
- 4 years ago
- 2 years ago