- fix issues with subsequent author substitute
- fix comma before "and" with two authors in MLA style citations
This commit is contained in:
parent
0042dde43d
commit
f3a16b5e00
|
@ -359,20 +359,28 @@ Zotero.CSL.prototype.preprocessItems = function(items) {
|
||||||
|
|
||||||
// disambiguate items after preprocessing and sorting
|
// disambiguate items after preprocessing and sorting
|
||||||
var usedCitations = new Array();
|
var usedCitations = new Array();
|
||||||
var lastAuthor;
|
var lastAuthors;
|
||||||
|
|
||||||
for(var i in items) {
|
for(var i in items) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
|
|
||||||
var formattedString = new Zotero.CSL.FormattedString(this, "disambiguate");
|
|
||||||
this._getFieldValue("author", this._getFieldDefaults("author"), item,
|
|
||||||
formattedString, this._bib);
|
|
||||||
var author = formattedString.get();
|
|
||||||
|
|
||||||
// handle subsequent author substitutes
|
// handle subsequent author substitutes
|
||||||
if(lastAuthor == author) {
|
Zotero.debug(item.getField("title"));
|
||||||
item._csl.subsequentAuthorSubstitute = true;
|
if(item._csl.authors.length && lastAuthors) {
|
||||||
|
var authorsAreSame = true;
|
||||||
|
for(var i=item._csl.authors.length-1; i>=0; i--) {
|
||||||
|
Zotero.debug(i);
|
||||||
|
if(!lastAuthors[i] ||
|
||||||
|
lastAuthors[i].firstName != item._csl.authors[i].firstName ||
|
||||||
|
lastAuthors[i].lastName != item._csl.authors[i].lastName ||
|
||||||
|
lastAuthors[i].creatorType != item._csl.authors[i].creatorType) {
|
||||||
|
authorsAreSame = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(authorsAreSame) item._csl.subsequentAuthorSubstitute = true;
|
||||||
|
}
|
||||||
|
lastAuthors = item._csl.authors;
|
||||||
|
|
||||||
// handle (2006a) disambiguation for author-date styles
|
// handle (2006a) disambiguation for author-date styles
|
||||||
if(this.class == "author-date") {
|
if(this.class == "author-date") {
|
||||||
|
@ -409,8 +417,6 @@ Zotero.CSL.prototype.preprocessItems = function(items) {
|
||||||
usedCitations[year] = item;
|
usedCitations[year] = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastAuthor = author;
|
|
||||||
|
|
||||||
// add numbers to each
|
// add numbers to each
|
||||||
item._csl.number = i;
|
item._csl.number = i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
-- 201
|
-- 202
|
||||||
|
|
||||||
-- ***** BEGIN LICENSE BLOCK *****
|
-- ***** BEGIN LICENSE BLOCK *****
|
||||||
--
|
--
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
-- Set the following timestamp to the most recent scraper update date
|
-- Set the following timestamp to the most recent scraper update date
|
||||||
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-03-22 23:26:24'));
|
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-03-23 14:45:00'));
|
||||||
|
|
||||||
REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-03-21 15:26:54', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon',
|
REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-03-21 15:26:54', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon',
|
||||||
'function detectWeb(doc, url) {
|
'function detectWeb(doc, url) {
|
||||||
|
@ -11390,7 +11390,7 @@ REPLACE INTO csl VALUES('http://www.zotero.org/namespaces/CSL/chicago-note-bibli
|
||||||
</bibliography>
|
</bibliography>
|
||||||
</style>');
|
</style>');
|
||||||
|
|
||||||
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/mla.csl', '2006-10-23 00:21:00', 'Modern Language Association',
|
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/mla.csl', '2007-03-23 14:45:00', 'Modern Language Association',
|
||||||
'<?xml version="1.0" encoding="UTF-8"?>
|
'<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<?oxygen RNGSchema="../schema/trunk/csl.rnc" type="compact"?>
|
<?oxygen RNGSchema="../schema/trunk/csl.rnc" type="compact"?>
|
||||||
<style xmlns="http://purl.org/net/xbiblio/csl" class="author" xml:lang="en">
|
<style xmlns="http://purl.org/net/xbiblio/csl" class="author" xml:lang="en">
|
||||||
|
@ -11453,7 +11453,7 @@ REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/mla.csl', '2006-
|
||||||
<layout>
|
<layout>
|
||||||
<item>
|
<item>
|
||||||
<author form="short">
|
<author form="short">
|
||||||
<name and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
|
<name and="text" sort-separator=", " delimiter=", "/>
|
||||||
</author>
|
</author>
|
||||||
<locator prefix=" "/>
|
<locator prefix=" "/>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user