diff --git a/chrome/content/zotero/xpcom/citeproc.js b/chrome/content/zotero/xpcom/citeproc.js index 180287a83..868b3bcc3 100644 --- a/chrome/content/zotero/xpcom/citeproc.js +++ b/chrome/content/zotero/xpcom/citeproc.js @@ -23,7 +23,7 @@ * respectively. */ var CSL = { - PROCESSOR_VERSION: "1.1.136", + PROCESSOR_VERSION: "1.1.138", CONDITION_LEVEL_TOP: 1, CONDITION_LEVEL_BOTTOM: 2, PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/, @@ -126,7 +126,8 @@ var CSL = { "hearing": true, "gazette": true, "report": true, - "regulation": true + "regulation": true, + "standard": true }, NestedBraces: [ ["(", "["], @@ -227,7 +228,7 @@ var CSL = { } return lst.join("-"); }, - parseNoteFieldHacks: function(Item, allowDateOverride) { + parseNoteFieldHacks: function(Item, validFieldsForType, allowDateOverride) { if ("string" !== typeof Item.note) return; var elems = []; var lines = Item.note.split('\n'); @@ -254,6 +255,7 @@ var CSL = { } } lines = lines.join('\n').split('\n'); + var offset = 0; var names = {}; for (var i=0,ilen=lines.length;i -1) { if (allowDateOverride) { Item[key] = {raw: val}; - lines[i] = ""; + if (!validFieldsForType || (validFieldsForType[key] && val.match(/^[0-9]{4}(?:-[0-9]{1,2}(?:-[0-9]{1,2})*)*$/))) { + lines[i] = ""; + } } } else if (!Item[key]) { if (CSL.NAME_VARIABLES.indexOf(key) > -1) { @@ -293,13 +298,25 @@ var CSL = { } else { Item[key] = val; } - lines[i] = ""; + if (!validFieldsForType || validFieldsForType[key]) { + lines[i] = ""; + } } } for (var key in names) { Item[key] = names[key]; } - Item.note = lines.join("").trim(); + if (validFieldsForType) { + if (lines[offset].trim()) { + lines[offset] = '\n' + lines[offset] + } + for (var i=offset-1;i>-1;i--) { + if (!lines[i].trim()) { + lines = lines.slice(0, i).concat(lines.slice(i + 1)); + } + } + } + Item.note = lines.join("\n").trim(); }, GENDERS: ["masculine", "feminine"], ERROR_NO_RENDERED_FORM: 1, @@ -2840,7 +2857,7 @@ CSL.Engine.prototype.retrieveItem = function (id) { } } if (this.opt.development_extensions.field_hack && Item.note) { - CSL.parseNoteFieldHacks(Item, this.opt.development_extensions.allow_field_hack_date_override); + CSL.parseNoteFieldHacks(Item, false, this.opt.development_extensions.allow_field_hack_date_override); } for (var i = 1, ilen = CSL.DATE_VARIABLES.length; i < ilen; i += 1) { var dateobj = Item[CSL.DATE_VARIABLES[i]]; @@ -6978,9 +6995,6 @@ CSL.Node.group = { state.buildTokenLists(myNodes[i], state.juris[jurisdiction][myName]); state.configureTokenList(state.juris[jurisdiction][myName]); } - if (macroCount < Object.keys(state.juris[jurisdiction].types).length) { - throw "CSL ERROR: Incomplete jurisdiction style module for: " + jurisdiction; - } } } for (var i=0,ilen=jurisdictionList.length;ichrome://zotero/content/about.xul chrome://zotero/skin/zotero-new-z-48px.png https://www.zotero.org/download/update-source.rdf + false 2 diff --git a/resource/schema/repotime.txt b/resource/schema/repotime.txt index 5edf32984..92a72e807 100644 --- a/resource/schema/repotime.txt +++ b/resource/schema/repotime.txt @@ -1 +1 @@ -2016-09-10 12:00:00 +2016-10-01 04:05:00 diff --git a/translators b/translators index e04633bae..4273554af 160000 --- a/translators +++ b/translators @@ -1 +1 @@ -Subproject commit e04633baeaac2c62eddb4435e517ae7d51c89a73 +Subproject commit 4273554afc20fe593b30faa6196edac9e755a7fa