Don't ignore whitespace when sorting
Intl.Collator's ignorePunctuation ignores whitespace too, so stop using it, since it produces much weirder results than sorting on punctuation does.
This commit is contained in:
parent
3c2bcf012f
commit
c7fd46e6b4
2 changed files with 16 additions and 2 deletions
|
@ -16,4 +16,15 @@ describe("Zotero", function() {
|
|||
assert.equal(str1, str2);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe("#localeCompare", function () {
|
||||
it("shouldn't ignore whitespace", function () {
|
||||
assert.equal(Zotero.localeCompare("Chang", "Chan H"), 1);
|
||||
});
|
||||
|
||||
it("shouldn't ignore leading punctuation", function () {
|
||||
assert.equal(Zotero.localeCompare("_Abcd", "Abcd"), -1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue