Skip to content

Commit

Permalink
Merge pull request playframework#253 from hwartig/lighthouse-882-patch
Browse files Browse the repository at this point in the history
[playframework#882] fixed slugify so that it removes leading/trailing -'s
  • Loading branch information
pepite committed Apr 6, 2012
2 parents f2b021e + 375fe3d commit aff952a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/src/play/templates/JavaExtensions.java
Expand Up @@ -367,7 +367,7 @@ public static String slugify(String string, Boolean lowercase) {
string = string.replaceAll("([a-z])'s([^a-z])", "$1s$2");
string = string.replaceAll("[^\\w]", "-").replaceAll("-{2,}", "-");
// Get rid of any - at the start and end.
string.replaceAll("-+$", "").replaceAll("^-+", "");
string = string.replaceAll("-+$", "").replaceAll("^-+", "");

return (lowercase ? string.toLowerCase() : string);
}
Expand Down

0 comments on commit aff952a

Please sign in to comment.