Skip to content

Conversation

@northword
Copy link
Contributor

@northword northword commented Oct 30, 2025

✅ Changes

  1. Support multiple values for the same key

    • getExtraFields(item, "custom") now returns Map<string, string[]> to allow multiple identical keys (e.g. multiple original-author entries).
    • getExtraFields(item, "default") overload remains compatible with Zotero's api and returns Map<string, string>.
  2. Move save to options: Both setExtraField and replaceExtraFields now use an options object instead of a standalone save argument (introduced in feat(extra-field-tool): allow disable save #95) for cleaner and extensible API design.

  3. Parser option: parser: "enhanced" | "classical" replaces the previous backend parameter.

    • enhanced: enhanced custom parser (multi-value support), original custom
    • classical: Zotero built-in parser (single value per key), original default
  4. Fixed __nonStandard__ handling

    • Prevented adding __nonStandard__: [""] when no non-standard lines exist in the extra field.

💥 BREAKING CHANGES

  • getExtraFields(item, "custom") now returns Map<string, string[]> instead of Map<string, string>. Code that previously expected a string value must now handle arrays.
  • The save argument in setExtraField and replaceExtraFields has been replaced by an options object ({ save?: boolean }).
  • parser replaces backend:
    • "enhanced" → custom enhanced parser
    • "classical" → Zotero built-in parser

@northword northword changed the title feat(extraField)!: support duplicate keys, move save to options, avoid empty __nonStandard__ feat(extraField)!: support duplicate keys, unify parser option, move save to options, avoid empty __nonStandard__ Oct 30, 2025
@windingwind windingwind merged commit 98f2bb7 into windingwind:main Nov 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants