minor tweak for name splitter (split on number)

This commit is contained in:
Sam 2013-06-28 16:15:13 +10:00
parent 6b82f1047a
commit 87f7bd921b
2 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,7 @@ Discourse.Formatter = (function(){
var firstPart = string.substr(0, maxLength);
var betterSplit = firstPart.substr(1).search(/[A-Z_]/);
var betterSplit = firstPart.substr(1).search(/[^a-z]/);
if (betterSplit >= 0) {
var offset = 1;
if(string[betterSplit+1] === "_") {

View File

@ -131,5 +131,6 @@ test("breakUp", function(){
equal(b("helloworld"), "hello world");
equal(b("HeMans"), "He Mans");
equal(b("he_man"), "he_ man");
equal(b("he11111"), "he 11111");
});