From 7c1845b3afabe7e4c9b750ca16847d83cb86b583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Mon, 6 Jan 2020 13:55:52 +0200 Subject: [PATCH] Citation dialog search improvements. Closes #1770. Closes #1499 Allows "p123" in addition to ":123" and "p.123" when specifying the locator; Allows searches with numbers only. --- chrome/content/zotero/integration/quickFormat.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 19e0653b5e..de92dca8f3 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -26,9 +26,9 @@ Components.utils.import("resource://gre/modules/Services.jsm"); var Zotero_QuickFormat = new function () { const pixelRe = /^([0-9]+)px$/ - const specifiedLocatorRe = /^(?:,? *(p{0,2})(?:\. *| +)|:)([0-9\-]+) *$/; + const specifiedLocatorRe = /^(?:,? *(p{1,2})(?:\. *| *)|:)([0-9\-]+) *$/; const yearRe = /,? *([0-9]+) *(B[. ]*C[. ]*(?:E[. ]*)?|A[. ]*D[. ]*|C[. ]*E[. ]*)?$/i; - const locatorRe = /(?:,? *(p{0,2})\.?|(\:)) *([0-9\-–]+)$/i; + const locatorRe = /(?:, *(p{0,2})\.?|(\:)) *([0-9\-–]+)$/i; const creatorSplitRe = /(?:,| *(?:and|\&)) +/; const charRe = /[\w\u007F-\uFFFF]/; const numRe = /^[0-9\-–]+$/; @@ -273,7 +273,6 @@ var Zotero_QuickFormat = new function () { } // check for year and pages - str = _updateLocator(str); m = yearRe.exec(str); if(m) { year = parseInt(m[1]);