diff --git a/.changeset/strange-hats-knock.md b/.changeset/strange-hats-knock.md new file mode 100644 index 000000000..6962ca3a5 --- /dev/null +++ b/.changeset/strange-hats-knock.md @@ -0,0 +1,5 @@ +--- +'myst-to-jats': patch +--- + +Ensure that DOI is normalized for JATS4R diff --git a/packages/myst-to-jats/src/frontmatter.ts b/packages/myst-to-jats/src/frontmatter.ts index 5223b3b92..bec6233f1 100644 --- a/packages/myst-to-jats/src/frontmatter.ts +++ b/packages/myst-to-jats/src/frontmatter.ts @@ -266,14 +266,15 @@ function instWrapElementsFromAffiliation(affiliation: Affiliation): Element[] { } if (affiliation.doi) { const doiAttrs: Record = { '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) { diff --git a/packages/myst-to-jats/tests/funding.yml b/packages/myst-to-jats/tests/funding.yml index 31244feb2..e7cd742ef 100644 --- a/packages/myst-to-jats/tests/funding.yml +++ b/packages/myst-to-jats/tests/funding.yml @@ -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'