Skip to content

Commit

Permalink
🐛 Normalize DOI for open-funder-registry (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Oct 11, 2023
1 parent 651dd77 commit 0e7a489
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-hats-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'myst-to-jats': patch
---

Ensure that DOI is normalized for JATS4R
5 changes: 3 additions & 2 deletions packages/myst-to-jats/src/frontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,15 @@ function instWrapElementsFromAffiliation(affiliation: Affiliation): Element[] {
}
if (affiliation.doi) {
const doiAttrs: Record<string, string> = { 'institution-id-type': 'doi' };
if (doi.isOpenFunderRegistry(affiliation.doi)) {
const funder = doi.isOpenFunderRegistry(affiliation.doi);
if (funder) {
doiAttrs.vocab = 'open-funder-registry';
}
instWrapElements.push({
type: 'element',
name: 'institution-id',
attributes: doiAttrs,
elements: [{ type: 'text', text: affiliation.doi }],
elements: [{ type: 'text', text: doi.normalize(affiliation.doi) }],
});
}
if (instWrapElements.length) {
Expand Down
2 changes: 1 addition & 1 deletion packages/myst-to-jats/tests/funding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ cases:
affiliations:
- id: univa
name: University A
doi: 10.13039/000000
doi: https://doi.org/10.13039/000000
isni: '0000000000000000'
ringgold: 99999
ror: '0000000000000000'
Expand Down

0 comments on commit 0e7a489

Please sign in to comment.