Fixes bug in test for quoted string when value is numeric
This commit is contained in:
parent
9d9d4faffb
commit
574e6197a2
1 changed files with 3 additions and 4 deletions
|
@ -1824,8 +1824,7 @@ Zotero.CSL.Item.prototype.getVariable = function(variable, form) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for each(var zoteroField in zoteroFields) {
|
for each(var zoteroField in zoteroFields) {
|
||||||
var value = this.zoteroItem.getField(zoteroField, false, true);
|
var value = this.zoteroItem.getField(zoteroField, false, true).toString();
|
||||||
value = value + '';
|
|
||||||
if(value != "") {
|
if(value != "") {
|
||||||
// Strip enclosing quotes
|
// Strip enclosing quotes
|
||||||
if(value.match(Zotero.CSL._quotedRegexp)) {
|
if(value.match(Zotero.CSL._quotedRegexp)) {
|
||||||
|
@ -1911,7 +1910,7 @@ Zotero.CSL.Item.prototype.getNumericVariable = function(variable, form) {
|
||||||
|
|
||||||
var matches;
|
var matches;
|
||||||
for each(var zoteroField in zoteroFields) {
|
for each(var zoteroField in zoteroFields) {
|
||||||
var value = this.zoteroItem.getField(zoteroField, false, true);
|
var value = this.zoteroItem.getField(zoteroField, false, true).toString();
|
||||||
|
|
||||||
// Quoted strings are never numeric
|
// Quoted strings are never numeric
|
||||||
if(value.match(Zotero.CSL._quotedRegexp)) {
|
if(value.match(Zotero.CSL._quotedRegexp)) {
|
||||||
|
@ -1919,7 +1918,7 @@ Zotero.CSL.Item.prototype.getNumericVariable = function(variable, form) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var matches;
|
var matches;
|
||||||
if(value != "" && (matches = value.toString().match(Zotero.CSL._numberRegexp)) ) {
|
if(value != "" && (matches = value.match(Zotero.CSL._numberRegexp)) ) {
|
||||||
value = matches[0];
|
value = matches[0];
|
||||||
if (form == "ordinal") {
|
if (form == "ordinal") {
|
||||||
return this.makeOrdinal(value);
|
return this.makeOrdinal(value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue