| # It works for pure text only. It will fail for html and url type of text. | |
| # http://henrik.nyh.se/2007/03/ruby-wordwrap-method | |
| def wrap_long_string(text,max_width = 20) | |
| (text.length < max_width) ? | |
| text : | |
| text.scan(/.{1,#{max_width}}/).join("<wbr>") | |
| end |