Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indentation in bibliography #3195

Merged
merged 1 commit into from Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 6 additions & 13 deletions chrome/content/zotero/xpcom/integration.js
Expand Up @@ -1348,18 +1348,11 @@ Zotero.Integration.Session.prototype._updateDocument = async function(forceCitat
} else {
bibliographyText = bib[0].bibstart+bib[1].join("")+bib[0].bibend;
}

// if bibliography style not set, set it
if(!this.data.style.bibliographyStyleHasBeenSet) {
var bibStyle = Zotero.Cite.getBibliographyFormatParameters(bib);

// set bibliography style
await this._doc.setBibliographyStyle(bibStyle.firstLineIndent, bibStyle.indent,
bibStyle.lineSpacing, bibStyle.entrySpacing, bibStyle.tabStops, bibStyle.tabStops.length);

// set bibliographyStyleHasBeenSet parameter to prevent further changes
this.data.style.bibliographyStyleHasBeenSet = true;
}

var bibStyle = Zotero.Cite.getBibliographyFormatParameters(bib);
await this._doc.setBibliographyStyle(bibStyle.firstLineIndent, bibStyle.indent,
bibStyle.lineSpacing, bibStyle.entrySpacing, bibStyle.tabStops, bibStyle.tabStops.length);
this.data.style.bibliographyStyleHasBeenSet = true;
}

// set bibliography text
Expand Down Expand Up @@ -3639,4 +3632,4 @@ Zotero.Integration.LegacyPluginWrapper.wrapDocument = function wrapDocument(doc)
return doc.convert.apply(doc, arguments);
}
return wrapped;
}
}