diff --git a/packages/@ember/string/index.ts b/packages/@ember/string/index.ts index 7c9cb1df0a9..a242eb9c8d1 100644 --- a/packages/@ember/string/index.ts +++ b/packages/@ember/string/index.ts @@ -53,7 +53,7 @@ const UNDERSCORE_CACHE = new Cache(1000, str => .toLowerCase() ); -const STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z\u00C0-\u024F])/g; +const STRING_CAPITALIZE_REGEXP = /(^|(?(1000, str => str.replace(STRING_CAPITALIZE_REGEXP, (match /*, separator, chr */) => match.toUpperCase()) diff --git a/packages/@ember/string/tests/capitalize_test.js b/packages/@ember/string/tests/capitalize_test.js index 3f5951802c5..1f9c6d2eba6 100644 --- a/packages/@ember/string/tests/capitalize_test.js +++ b/packages/@ember/string/tests/capitalize_test.js @@ -52,6 +52,12 @@ moduleFor( 'Private-docs/Owner-invoice', 'capitalize namespaced dasherized string' ); + test( + assert, + 'url is http://www.emberjs.com, not http:///www.emberjs.com', + 'Url is http://www.emberjs.com, not http:///www.emberjs.com', + 'does nothing with multiple slashes' + ); test(assert, 'šabc', 'Šabc', 'capitalize string with accent character'); } }