Zotero utility code
转到文件
Dan Stillman eab0922a2d capitalizeTitle(): Handle HTML tags
https://forums.zotero.org/discussion/113653/zotero-7-beta-incorrect-behaviour-applying-title-case-action-to-titles-with-rich-text-markup

For `<i>Title case</i>`, return `<i>Title Case</i>` instead of `<i>title Case</I>`.
2024-04-14 03:19:35 -04:00
.github/workflows Add GitHub Actions workflow 2022-05-02 11:50:50 -07:00
resource Update instructions for generating zoteroTypeSchemaData.js 2023-05-06 02:03:02 -04:00
test capitalizeTitle(): Handle HTML tags 2024-04-14 03:19:35 -04:00
.gitignore Move tests from client (#9) 2022-04-28 17:42:01 -04:00
.gitmodules Move tests from client (#9) 2022-04-28 17:42:01 -04:00
COPYING Add COPYING 2021-07-26 10:36:10 +03:00
README.md Move tests from client (#9) 2022-04-28 17:42:01 -04:00
cachedTypes.js Tweak exports for use in web (#17) 2022-08-16 00:44:54 -04:00
date.js Fix always-true comparisons in isToday() 2024-04-05 08:32:32 +03:00
openurl.js Remove OpenURL resolve() and discoverResolvers() 2021-08-13 06:04:24 -04:00
package-lock.json Move tests from client (#9) 2022-04-28 17:42:01 -04:00
package.json Move tests from client (#9) 2022-04-28 17:42:01 -04:00
schema.js Tweak exports for use in web (#17) 2022-08-16 00:44:54 -04:00
utilities.js capitalizeTitle(): Handle HTML tags 2024-04-14 03:19:35 -04:00
utilities_item.js Add support for correct sorting with other call numbers (#30) 2023-10-06 06:57:48 -04:00
xregexp-all.js Initial commit 2021-07-23 16:20:21 +03:00
xregexp-unicode-zotero.js Initial commit 2021-07-23 16:20:21 +03:00

README.md

Zotero Utilities

Zotero utility code common across various codebases such as the Zotero client, Zotero translation architecture and others.

Item utility functions require:

  • Calling Zotero.Schema.init(json) with the JSON from schema.json from Zotero schema repo
  • Calling Zotero.Date.init(json) with the JSON from resource/dateFormats.json
  • Loading resource/zoteroTypeSchemaData.js before cachedTypes.js or in Node.js running
      let CachedTypes = require('./cachedTypes')
      CachedTypes.setTypeSchema(require('./resource/zoteroTypeSchemaData'))
    
  • Implementing Zotero.localeCompare(); a simple implementation would be
      let collator = new Intl.Collator(['en-US'], {
        numeric: true,
        sensitivity: 'base'
      });
      Zotero.localeCompare = (a, b) => collator.compare(a, b);
    

Please bundle the Zotero schema file with your repository, do not load it remotely.

To run tests: npm i && npm test.