-
Turns all urls and email addresses into clickable links. The +link+ parameter can limit what should be linked.
Options are :all (default), :email_addresses, and :urls.
Example:
auto_link("Go to http://www.symfony-project.com and say hello to fabien.potencier@example.com") =>
Go to http://www.symfony-project.com and
say hello to fabien.potencier@example.com
-
Extracts an excerpt from the +text+ surrounding the +phrase+ with a number of characters on each side determined
by +radius+. If the phrase isn't found, nil is returned. Ex:
excerpt("hello my world", "my", 3) => "...lo my wo..."
If +excerpt_space+ is true the text will only be truncated on whitespace, never inbetween words.
This might return a smaller radius than specified.
excerpt("hello my world", "my", 3, "...", true) => "... my ..."
-
Highlights the +phrase+ where it is found in the +text+ by surrounding it like
I'm a highlight phrase. The highlighter can be specialized by
passing +highlighter+ as single-quoted string with \1 where the phrase is supposed to be inserted.
N.B.: The +phrase+ is sanitized to include only letters, digits, and spaces before use.
-
-
-
Truncates +text+ to the length of +length+ and replaces the last three characters with the +truncate_string+
if the +text+ is longer than +length+.
-
Word wrap long lines to line_width.
-
_auto_link_email_addresses ()
Browse code
Turns all email addresses into clickable links.
-
Turns all urls into clickable links.