Created
August 28, 2009 15:35
-
-
Save marcroberts/177044 to your computer and use it in GitHub Desktop.
Add soft hyphens every 6 characters to words longer than 7 characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ActionView | |
| module Helpers | |
| module TextHelper | |
| def simple_format_with_hyphenation(text, html_options={}) | |
| simple_format_without_hyphenation(text.gsub(/(\w{6})(\w)/,'\1­\2'), html_options) | |
| end | |
| alias_method_chain :simple_format, :hyphenation | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment