Shorten sortIndex to 22 characters

This commit is contained in:
Dan Stillman 2020-09-01 03:43:51 -04:00
parent 63a416db40
commit 078a18f7c0
2 changed files with 5 additions and 5 deletions

View file

@ -3531,7 +3531,7 @@ for (let name of ['type', 'text', 'comment', 'color', 'pageLabel', 'sortIndex'])
break;
case 'sortIndex':
if (!/^\d{6}\|\d{7}\|\d{6}\.\d{3}$/.test(value)) {
if (!/^\d{5}\|\d{6}\|\d{5}\.\d{3}$/.test(value)) {
throw new Error(`Invalid sortIndex '${value}`);
}
break;

View file

@ -7,7 +7,7 @@ describe("Zotero.Annotations", function() {
"comment": "This is a comment with <i>rich-text</i>\nAnd a new line",
"color": "#ffec00",
"pageLabel": "15",
"sortIndex": "000015|0002431|000000.000",
"sortIndex": "00015|002431|00000.000",
"position": {
"pageIndex": 1,
"rects": [
@ -37,7 +37,7 @@ describe("Zotero.Annotations", function() {
"comment": "This is a note",
"color": "#ffec00",
"pageLabel": "14",
"sortIndex": "000014|0001491|000283.000",
"sortIndex": "00014|001491|00283.000",
"position": {
"pageIndex": 0,
"rects": [
@ -55,7 +55,7 @@ describe("Zotero.Annotations", function() {
"comment": "This is a comment",
"color": "#ffec00",
"pageLabel": "XVI",
"sortIndex": "000016|0003491|000683.000",
"sortIndex": "00016|003491|00683.000",
"position": {
"pageIndex": 123,
"rects": [
@ -76,7 +76,7 @@ describe("Zotero.Annotations", function() {
"comment": "This is a comment with <i>rich-text</i>\nAnd a new line",
"color": "#ffec00",
"pageLabel": "15",
"sortIndex": "000015|0002431|000000.000",
"sortIndex": "00015|002431|00000.000",
"position": {
"pageIndex": 1,
"rects": [