mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 14:13:38 +08:00
minor tweak for name splitter (split on number)
This commit is contained in:
parent
6b82f1047a
commit
87f7bd921b
|
@ -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] === "_") {
|
||||
|
|
|
@ -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");
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user