Created
August 30, 2011 05:14
-
-
Save destroytoday/1180233 to your computer and use it in GitHub Desktop.
Adds a non-breaking space to the last space of a string, avoiding widows/orphans.
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 Jekyll | |
module Filters | |
def remarry_widows(input) | |
newinput = input.gsub(/ ([^ ]+)$/, " \\1") | |
newinput | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment