Commit graph

19 commits

Author SHA1 Message Date
Dan Stillman
36dc88ce08 Fix error using a CSL 0.8 style
transformToDocument() needs a load group, which it takes from the source
document or from the window that created the XSLTProcessor. Neither of
those has existed since 0f2690eb75 in Zotero 8 stopped taking
XSLTProcessor from the hidden window, so the CSL 0.8 → 1.0 upgrade threw
NS_ERROR_FAILURE. In Word, this showed as "Zotero encountered an error
while updating your document."

https://forums.zotero.org/discussion/133543/

(cherry picked from commit 4a8a88dd41)
2026-09-01 15:49:23 -04:00
Dan Stillman
6c5d160895 Fix citing and locale selection for locales without a CSL locale
The CSL locales repository replaced locales-sr-RS.xml with script
variants, so citing with a stored or default 'sr-RS' locale loaded no
terms and failed with an et-al error. Resolve unavailable locales to
the closest available CSL locale (sr-Cyrl-RS for sr-RS) when rendering
and in locale selectors.

https://forums.zotero.org/discussion/comment/515598/#Comment_515598
2026-07-16 11:28:21 -04:00
Dan Stillman
cfd5596814 Disable locale selector when parent style specifies default-locale
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
For a dependent CSL style with no default-locale of its own, citeproc-js
parses the parent's XML and silently uses the parent's default-locale
over any user-selected locale, making the locale dropdown a no-op. Add
a Zotero.Style.effectiveLocale getter that falls back to the parent's
locale, and use it in updateLocaleList and the locale-selector custom
element to disable the dropdown in that case.

https://forums.zotero.org/discussion/comment/512891/#Comment_512891
2026-05-21 22:32:23 -04:00
Dan Stillman
5a347f4be5 Update style test for NLM/Vancouver style changes 2026-04-02 16:11:47 -04:00
Abe Jellinek
3c6ad491b5
Fix citations accumulating due to CSL.Engine caching (#5742)
* makeFormattedBibliographyOrCitationList(): Don't modify CSL.Engine state

Use previewCitationCluster(), which leaves the processor state alone,
instead of calling appendCitationCluster(), which has side effects and
isn't used anywhere else in Zotero.

* Make CSL.Engine caching opt-in

* Remove unnecessary CSL.Engine reinitialization

* Code style

* Add/update tests
2026-01-26 16:12:36 -05:00
Adomas Ven
6697db1dba
Delete duplicate renamed styles on init (#5734)
After citation-style-language/styles#7928 renamed Vancouver styles to
NLM terminology, Zotero installations end up with both vancouver.csl
and nlm-citation-sequence.csl. To fix, on init, delete any installed style
whose ID appears in the renamed-styles mapping if the target style
also exists.

---------

Co-authored-by: Dan Stillman <dstillman@zotero.org>
2026-01-26 10:35:43 -05:00
Dan Stillman
a34b845154 Update style test to use NLM citation-sequence instead of Vancouver 2026-01-26 00:43:06 -05:00
Dan Stillman
2bb8ba60ad Fix test after adding eventPlace to conferencePaper 2026-01-13 12:50:00 -05:00
Abe Jellinek
08e4d6b06b Stop using restoreProcessorState() (#5516)
restoreProcessorState() breaks locale-specific punctuation (and is
deprecated).

rebuildProcessorState() is enough if we're passing an empty citation
list; if we're reinitializing with a new non-empty list, call
updateItems() first.

Also:

- Add tests for this issue and for potential regressions in disambiguation handling
2025-08-26 00:44:14 -04:00
Abe Jellinek
67d2e1cead fx140: Asyncify/ESMify tests
They seem to be succeeding when run individually, but failing when
run as a whole. Not sure why yet.
2025-07-30 22:30:53 -04:00
Dan Stillman
c90f8415b3 Improve test for event-title substitution
And add comments

Follow-up to 20d0f103f
2022-08-11 03:57:25 -04:00
Dan Stillman
7eab91a160 Automatically substitute event-title for event in styles
Stopgap until styles are updated in citation-style-language/styles#6151
2022-08-11 03:57:15 -04:00
Dan Stillman
cef47aaef6 Update test after AMA update 2020-05-09 19:30:41 -04:00
Dan Stillman
9becefc3fd Fix test for AMA subtitle capitalization 2019-08-01 17:32:56 -04:00
Dan Stillman
f49d5805cd Apply subtitle capitalization to additional styles
This also fixes a style initialization error when the style id is
invalid, which was a regression in a0be2da42c.
2019-07-01 22:39:12 -04:00
Sylvester Keil
37412c68ff
Fix style download stub 2018-08-03 13:42:15 +02:00
Tom Najdek
063e13ef22 Modernize sinon.stub() calls 2017-06-01 11:36:17 -04:00
Adomas Venčkauskas
02c43c3643 Add integrationTests.js
Contains a dummy doc plugin, which is useful for:
- Testing integration.js functionality
- Serving as succint documentation for development of new integration
  plugins
2017-04-12 11:45:10 +03:00
Adomas Venčkauskas
269a250b4f Fetch a style if it is not installed on document preferences load 2017-04-10 11:24:22 +03:00