You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ardes::TruncateHtml is just like the vanilla truncate rails helper, except it respects tags and html entities, and returns valid html.
3
+
TruncateHtml is just like the vanilla truncate rails helper, except it respects tags and html entities, and returns valid html.
4
4
5
5
Rexml and HtmlEntities are used for the parsing. If the input is invalid html, then hpricot is used to fix it up (but is not used when the input is fine).
# Truncates html respecting tags and html entities.
12
+
#
13
+
# The API is the same as ActionView::Helpers::TextHelper#truncate. It uses Rexml for the parsing, and HtmlEntities for entity awareness. If Rexml raises a ParseException, then Hpricot is used to fixup the tags, and we try again
0 commit comments