2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

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 firstPart = string.substr(0, maxLength);
var betterSplit = firstPart.substr(1).search(/[A-Z_]/); var betterSplit = firstPart.substr(1).search(/[^a-z]/);
if (betterSplit >= 0) { if (betterSplit >= 0) {
var offset = 1; var offset = 1;
if(string[betterSplit+1] === "_") { if(string[betterSplit+1] === "_") {

View file

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