From b60fb28313f691904f82def55ef79544ea16f687 Mon Sep 17 00:00:00 2001 From: CommonLoon102 <321850+CommonLoon102@users.noreply.github.com> Date: Sat, 1 Jul 2023 13:15:44 +0200 Subject: [PATCH] Fix indentation in bibliography Fix indentation in bibliography when a new item is added and therefore the recalculation of indents are needed. https://forums.zotero.org/discussion/23689/bibliography-indentation --- chrome/content/zotero/xpcom/integration.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 6f18a22fe0..6e734e3152 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -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 @@ -3639,4 +3632,4 @@ Zotero.Integration.LegacyPluginWrapper.wrapDocument = function wrapDocument(doc) return doc.convert.apply(doc, arguments); } return wrapped; -} \ No newline at end of file +}