Skip to content

Commit ef668bd

Browse files
authored
🧪 Remove short DOI test in latex (#2572)
1 parent 70f816c commit ef668bd

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

packages/myst-cli/src/transforms/doi.spec.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,35 @@ const PRIESTLEY_1972_CSL_JSON = [
1919
volume: '100',
2020
},
2121
];
22+
23+
const BARTELS_1997_CSL_JSON = [
24+
{
25+
DOI: '10.1002/(sici)1096-987x(199709)18:12<1450::aid-jcc3>3.0.co;2-i',
26+
// ISSN: '0192-8651',
27+
// URL: 'http://dx.doi.org/10.1002/(SICI)1096-987X(199709)18:12<1450::AID-JCC3>3.0.CO;2-I',
28+
author: [
29+
{
30+
family: 'Bartels',
31+
given: 'Christian',
32+
},
33+
{
34+
family: 'Karplus',
35+
given: 'Martin',
36+
},
37+
],
38+
'container-title': 'Journal of Computational Chemistry',
39+
issue: '12',
40+
issued: {
41+
'date-parts': [[1997, 9]],
42+
},
43+
page: '1450-1462',
44+
publisher: 'Wiley',
45+
title:
46+
'Multidimensional adaptive umbrella sampling: Applications to main chain and side chain peptide conformations',
47+
type: 'article-journal',
48+
volume: '18',
49+
},
50+
];
2251
describe.each([
2352
{ resolver: resolveDOIAsBibTeX, name: 'BibTeX' },
2453
{ resolver: resolveDOIAsCSLJSON, name: 'CSL-JSON' },
@@ -41,4 +70,15 @@ describe.each([
4170
);
4271
expect(data).toMatchObject(PRIESTLEY_1972_CSL_JSON);
4372
});
73+
it('markdown link with strange characters resolves', async () => {
74+
const data = await resolver(
75+
new Session(),
76+
'https://doi.org/10.1002/(SICI)1096-987X(199709)18:12%3C1450::AID-JCC3%3E3.0.CO;2-I',
77+
);
78+
// Both of these are different depending on the resolver
79+
// The URL is encoded, the ISSN is actually different?!
80+
delete data?.[0].URL;
81+
delete data?.[0].ISSN;
82+
expect(data).toMatchObject(BARTELS_1997_CSL_JSON);
83+
});
4484
});

packages/mystmd/tests/dois/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ Nonexistent DOI citation (errors!): [](https://doi.org/10.1111/j.1365-246X.2012.
2020
DOI with with invalid BibTeX: [](10.2903/j.efsa.2019.5779)
2121

2222
DOI with with invalid BibTeX as cite node: @10.2903/j.efsa.2019.5779
23-
24-
DOI with some strange characters: [](https://doi.org/10.1002/(SICI)1096-987X(199709)18:12%3C1450::AID-JCC3%3E3.0.CO;2-I)
25-
26-
Short DOI: [](https://doi.org/cr3qwn)

packages/mystmd/tests/dois/outputs/dois.bib

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -73,35 +73,3 @@ @article{EFSA2019Dietary
7373
volume = {17},
7474
}
7575

76-
77-
@article{Bartels_1997,
78-
author = {Bartels, Christian and Karplus, Martin},
79-
journal = {Journal of Computational Chemistry},
80-
doi = {10.1002/(sici)1096-987x(199709)18:12<1450::aid-jcc3>3.0.co;2-i},
81-
issn = {1096-987X},
82-
number = {12},
83-
year = {1997},
84-
month = {9},
85-
pages = {1450--1462},
86-
publisher = {Wiley},
87-
title = {Multidimensional adaptive umbrella sampling: Applications to main chain and side chain peptide conformations},
88-
url = {http://dx.doi.org/10.1002/(SICI)1096-987X(199709)18:12%3C1450::AID-JCC3%3E3.0.CO;2-I},
89-
volume = {18},
90-
}
91-
92-
93-
@article{PRIESTLEY_1972,
94-
author = {PRIESTLEY, C. H. B. and TAYLOR, R. J.},
95-
journal = {Monthly Weather Review},
96-
doi = {10.1175/1520-0493(1972)100<0081:otaosh>2.3.co;2},
97-
issn = {1520-0493},
98-
number = {2},
99-
year = {1972},
100-
month = {2},
101-
pages = {81--92},
102-
publisher = {American Meteorological Society},
103-
title = {On the {Assessment} of {Surface} {Heat} {Flux} and {Evaporation} {Using} {Large}-{Scale} {Parameters}},
104-
url = {http://dx.doi.org/10.1175/1520-0493(1972)100%3C0081:OTAOSH%3E2.3.CO;2},
105-
volume = {100},
106-
}
107-

packages/mystmd/tests/dois/outputs/dois.tex

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@
7878

7979
DOI with with invalid BibTeX as cite node: \cite{EFSA2019Dietary}
8080

81-
DOI with some strange characters: \cite{Bartels_1997}
82-
83-
Short DOI: \cite{PRIESTLEY_1972}
84-
8581

8682
\bibliography{main.bib}
8783

0 commit comments

Comments
 (0)