I am using the truncate
function to show part of a text, next to this function I added the function html_safe
so that the text does not show unwanted characters. But when the text is greater than the limit I set, length: 150
, the unwanted characters reappear.
I would like a solution to this, truncate the text but do not show the unwanted characters.
<%= truncate(service.description.html_safe, length: 15, )