Skip to content

Commit

Permalink
[BUGFIX beta] Don't capitalize characters following multiple forward …
Browse files Browse the repository at this point in the history
…slashes
  • Loading branch information
GavinJoyce committed Apr 5, 2019
1 parent ad830c6 commit 9835b3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@ember/string/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const UNDERSCORE_CACHE = new Cache<string, string>(1000, str =>
.toLowerCase()
);

const STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z\u00C0-\u024F])/g;
const STRING_CAPITALIZE_REGEXP = /(^|(?<!\/)\/(?!\/))([a-z\u00C0-\u024F])/g;

const CAPITALIZE_CACHE = new Cache<string, string>(1000, str =>
str.replace(STRING_CAPITALIZE_REGEXP, (match /*, separator, chr */) => match.toUpperCase())
Expand Down
6 changes: 6 additions & 0 deletions packages/@ember/string/tests/capitalize_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down

0 comments on commit 9835b3e

Please sign in to comment.