@amermathsoc/texml-to-html 18.2.0 → 18.3.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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [18.3.0](https://github.com/AmerMathSoc/texml-to-html/compare/v18.2.0...v18.3.0) (2025-02-24)
6
+
7
+
8
+ ### Features
9
+
10
+ * **abstract.js:** support lang attribute ([4f27f2a](https://github.com/AmerMathSoc/texml-to-html/commit/4f27f2a1f87951e4020ec3add9087b6806162f5e)), closes [#474](https://github.com/AmerMathSoc/texml-to-html/issues/474)
11
+
5
12
  ## [18.2.0](https://github.com/AmerMathSoc/texml-to-html/compare/v18.1.0...v18.2.0) (2025-02-05)
6
13
 
7
14
 
@@ -29,6 +29,7 @@ export default function (htmlParentNode, xmlnode) {
29
29
  role: 'doc-abstract'
30
30
  });
31
31
  mapAttributes(section, xmlnode);
32
+ if (xmlnode.getAttribute('xml:lang')) section.setAttribute('lang', xmlnode.getAttribute('xml:lang')); // NOTE: after AmerMathSoc/texml#192, we may want a more general solution (e.g., mapAttributes())
32
33
  htmlParentNode.appendChild(section);
33
34
  this.createHeading(section, xmlnode);
34
35
  this.passThrough(section, xmlnode);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amermathsoc/texml-to-html",
3
- "version": "18.2.0",
3
+ "version": "18.3.0",
4
4
  "type": "module",
5
5
  "description": "A NodeJS library for converting AMS-style JATS XML to HTML",
6
6
  "scripts": {
@@ -84,7 +84,7 @@
84
84
  </history>
85
85
  <article-id pub-id-type="doi">doi</article-id>
86
86
  <article-id pub-id-type="pii">pii</article-id>
87
- <abstract/>
87
+ <abstract xml:lang="fr"/>
88
88
  </article-meta>
89
89
  <journal-meta>
90
90
  <journal-id journal-id-type="publisher">journalId</journal-id>
@@ -14,14 +14,17 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { article } from './helper.js';
17
+ import { article, articleAlttitle } from './helper.js';
18
18
  import tape from 'tape';
19
19
 
20
20
 
21
21
  tape('abstract, abstract/title', async function(t) {
22
- t.plan(2);
22
+ t.plan(4);
23
23
  const document = article;
24
24
  const abstract = document.querySelector('section[data-ams-doc-level="1"][role="doc-abstract"]');
25
25
  t.ok(abstract, 'Abstract as Section with data-ams-doc-level 1, role doc-abstract');
26
26
  t.ok(abstract.querySelector('h2'), 'Abstract title as h2');
27
+ t.notOk(abstract.hasAttribute('lang'), 'abstract without lang')
28
+ const document2 = articleAlttitle;
29
+ t.equal(document2.querySelector('[role="doc-abstract"]').getAttribute('lang'), 'fr', 'Abstract with lang')
27
30
  });
@@ -92,7 +92,7 @@
92
92
  ]
93
93
  },
94
94
  "keywords": []
95
- }</script><header><h1>article-title</h1><p data-ams-doc="subtitle">article-subtitle</p></header><section data-ams-content-type="article" data-ams-doc="notes"></section><section role="doc-abstract" data-ams-doc-level="1"></section><ul data-ams-doc="keywords"></ul><div data-ams-doc="funding-group">
95
+ }</script><header><h1>article-title</h1><p data-ams-doc="subtitle">article-subtitle</p></header><section data-ams-content-type="article" data-ams-doc="notes"></section><section lang="fr" role="doc-abstract" data-ams-doc-level="1"></section><ul data-ams-doc="keywords"></ul><div data-ams-doc="funding-group">
96
96
  <p></p>
97
97
  </div></section>
98
98