@amermathsoc/texml-to-html 16.1.1 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/lib/helpers/extractContribGroups.js +4 -4
- package/package.json +1 -1
- package/test/article--alttitle.xml +3 -3
- package/test/article.xml +2 -2
- package/test/book.xml +4 -4
- package/test/element-sec-meta.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [17.0.0](https://github.com/AmerMathSoc/texml-to-html/compare/v16.1.1...v17.0.0) (2024-06-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* Expects role instead author-comment
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* adjust to texml renaming author-comment to role ([c46822b](https://github.com/AmerMathSoc/texml-to-html/commit/c46822b9e6cbd96de1893c8e138f3f14df48492c)), closes [#449](https://github.com/AmerMathSoc/texml-to-html/issues/449)
|
|
15
|
+
|
|
5
16
|
### [16.1.1](https://github.com/AmerMathSoc/texml-to-html/compare/v16.1.0...v16.1.1) (2024-06-03)
|
|
6
17
|
|
|
7
18
|
|
|
@@ -75,14 +75,14 @@ export function extractContribGroups(articleMetaNode) {
|
|
|
75
75
|
contributor.orcid = contrib.querySelector('contrib-id[contrib-id-type="orcid"]')?.textContent;
|
|
76
76
|
|
|
77
77
|
contributor.uri = contrib.querySelector('uri')?.textContent;
|
|
78
|
-
//
|
|
79
|
-
const
|
|
80
|
-
if (index === 0 &&
|
|
78
|
+
// role (NOTE: child of contrib-group but it's easier if we copy it to each contributor)
|
|
79
|
+
const role = contrib.parentNode.querySelector('role')?.textContent;
|
|
80
|
+
if (index === 0 && role) contributor.byline = role;
|
|
81
81
|
contributorsArray.push(contributor);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const extractContribGroup = function (contributors, contribGroup) {
|
|
85
|
-
contributors[contribGroup.getAttribute('content-type')] ??= []; // NOTE: jams410 has 2 contrib-groups with content-type=contributors (but different
|
|
85
|
+
contributors[contribGroup.getAttribute('content-type')] ??= []; // NOTE: jams410 has 2 contrib-groups with content-type=contributors (but different roles); cf. #408
|
|
86
86
|
contribGroup.querySelectorAll('contrib').forEach(extractContrib.bind(this, contributors[contribGroup.getAttribute('content-type')]));
|
|
87
87
|
};
|
|
88
88
|
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<bio>Some biographical info with <email>email</email></bio>
|
|
19
19
|
</contrib>
|
|
20
20
|
<aff id="aff">aff</aff>
|
|
21
|
-
<
|
|
21
|
+
<role>comment</role>
|
|
22
22
|
</contrib-group>
|
|
23
23
|
<contrib-group content-type="contribBs">
|
|
24
24
|
<contrib contrib-type="contribB">
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</contrib>
|
|
37
37
|
<aff id="aff1" specific-use="current">Aff1</aff>
|
|
38
38
|
<aff id="aff2">Aff2</aff>
|
|
39
|
-
<
|
|
39
|
+
<role>comment</role>
|
|
40
40
|
</contrib-group>
|
|
41
41
|
<funding-group>
|
|
42
42
|
<funding-statement/>
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
</contrib>
|
|
119
119
|
</contrib-group>
|
|
120
120
|
<contrib-group content-type="contributors">
|
|
121
|
-
<
|
|
121
|
+
<role>with</role>
|
|
122
122
|
<contrib contrib-type="contributor">
|
|
123
123
|
<string-name>Author 2</string-name>
|
|
124
124
|
<bio>Author 2 Bio</bio>
|
package/test/article.xml
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<uri>uri</uri>
|
|
48
48
|
</contrib>
|
|
49
49
|
<aff id="aff">aff</aff>
|
|
50
|
-
<
|
|
50
|
+
<role>comment</role>
|
|
51
51
|
</contrib-group>
|
|
52
52
|
<contrib-group content-type="contribBs">
|
|
53
53
|
<contrib contrib-type="contribB">
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
</contrib>
|
|
67
67
|
<aff id="aff1" specific-use="current">Aff1</aff>
|
|
68
68
|
<aff id="aff2">Aff2</aff>
|
|
69
|
-
<
|
|
69
|
+
<role>comment</role>
|
|
70
70
|
</contrib-group>
|
|
71
71
|
<funding-group>
|
|
72
72
|
<funding-statement>Funding 1</funding-statement>
|
package/test/book.xml
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<uri>uri</uri>
|
|
52
52
|
</contrib>
|
|
53
53
|
<aff id="aff1">aff</aff>
|
|
54
|
-
<
|
|
54
|
+
<role>comment</role>
|
|
55
55
|
</contrib-group>
|
|
56
56
|
<contrib-group content-type="contrib-group-type2">
|
|
57
57
|
<contrib contrib-type="contrib-type2">
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</contrib>
|
|
63
63
|
</contrib-group>
|
|
64
64
|
<contrib-group content-type="contrib-group-type3">
|
|
65
|
-
<
|
|
65
|
+
<role>comment</role>
|
|
66
66
|
<contrib contrib-type="contrib-type3">
|
|
67
67
|
<name name-style="given-only">
|
|
68
68
|
<given-names>should be ignored</given-names>
|
|
@@ -218,9 +218,9 @@
|
|
|
218
218
|
<sec-meta>
|
|
219
219
|
<contrib-group>
|
|
220
220
|
<!-- NOTE: this contrib-group example is for MCL 1, 14 only; intentionally broken via #254 -->
|
|
221
|
-
<
|
|
221
|
+
<role>
|
|
222
222
|
comment
|
|
223
|
-
</
|
|
223
|
+
</role>
|
|
224
224
|
</contrib-group>
|
|
225
225
|
<abstract>
|
|
226
226
|
<title>Abstract</title>
|
package/test/element-sec-meta.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { article, articleAlttitle, book } from './helper.js';
|
|
18
18
|
import tape from 'tape';
|
|
19
19
|
|
|
20
|
-
tape('Template: sec-meta => contrib-group,
|
|
20
|
+
tape('Template: sec-meta => contrib-group, role, abstract/title', async function (t) {
|
|
21
21
|
t.plan(10);
|
|
22
22
|
|
|
23
23
|
const document = book;
|