From b8eeb3abaa3bbb972176109daa17af1e38126bbc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 9 Sep 2020 00:14:11 -0400 Subject: [PATCH] Drop decimal places from annotation sortIndex --- chrome/content/zotero/xpcom/data/item.js | 2 +- test/tests/annotationsTest.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 1532f7a7ed..8e489e59c1 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -3538,7 +3538,7 @@ for (let name of ['type', 'text', 'comment', 'color', 'pageLabel', 'sortIndex']) break; case 'sortIndex': - if (!/^\d{5}\|\d{6}\|\d{5}\.\d{3}$/.test(value)) { + if (!/^\d{5}\|\d{6}\|\d{5}$/.test(value)) { throw new Error(`Invalid sortIndex '${value}`); } break; diff --git a/test/tests/annotationsTest.js b/test/tests/annotationsTest.js index a731fdcbf9..ceb9c7923b 100644 --- a/test/tests/annotationsTest.js +++ b/test/tests/annotationsTest.js @@ -7,7 +7,7 @@ describe("Zotero.Annotations", function() { "comment": "This is a comment with rich-text\nAnd a new line", "color": "#ffec00", "pageLabel": "15", - "sortIndex": "00015|002431|00000.000", + "sortIndex": "00015|002431|00000", "position": { "pageIndex": 1, "rects": [ @@ -37,7 +37,7 @@ describe("Zotero.Annotations", function() { "comment": "This is a note", "color": "#ffec00", "pageLabel": "14", - "sortIndex": "00014|001491|00283.000", + "sortIndex": "00014|001491|00283", "position": { "pageIndex": 0, "rects": [ @@ -55,7 +55,7 @@ describe("Zotero.Annotations", function() { "comment": "This is a comment", "color": "#ffec00", "pageLabel": "XVI", - "sortIndex": "00016|003491|00683.000", + "sortIndex": "00016|003491|00683", "position": { "pageIndex": 123, "rects": [ @@ -76,7 +76,7 @@ describe("Zotero.Annotations", function() { "comment": "This is a comment with rich-text\nAnd a new line", "color": "#ffec00", "pageLabel": "15", - "sortIndex": "00015|002431|00000.000", + "sortIndex": "00015|002431|00000", "position": { "pageIndex": 1, "rects": [