@amermathsoc/texml-to-html 20.1.0 → 20.2.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,20 @@
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
+ ## [20.2.0](https://github.com/AmerMathSoc/texml-to-html/compare/v20.1.1...v20.2.0) (2026-02-19)
6
+
7
+
8
+ ### Features
9
+
10
+ * **attrib.js:** map attributes ([c8bd479](https://github.com/AmerMathSoc/texml-to-html/commit/c8bd4799faba54f4d79e34476d393484a147285d)), closes [#499](https://github.com/AmerMathSoc/texml-to-html/issues/499)
11
+
12
+ ## [20.1.1](https://github.com/AmerMathSoc/texml-to-html/compare/v20.1.0...v20.1.1) (2026-01-13)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **postProcessing.js:** s tag is phrasing content ([f4b2561](https://github.com/AmerMathSoc/texml-to-html/commit/f4b2561f40ff309f8275a374e7fdd61b80f2f83e)), closes [#498](https://github.com/AmerMathSoc/texml-to-html/issues/498)
18
+
5
19
  ## [20.1.0](https://github.com/AmerMathSoc/texml-to-html/compare/v20.0.0...v20.1.0) (2026-01-13)
6
20
 
7
21
 
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import mapAttributes from '../helpers/mapAttributes.js';
16
17
 
17
18
  /**
18
19
  * attrib element
@@ -22,5 +23,6 @@
22
23
  export default function (htmlParentNode, xmlnode) {
23
24
  const span = this.createNode('span', '', { 'data-ams-doc': 'attribution' });
24
25
  htmlParentNode.appendChild(span);
26
+ mapAttributes(span, xmlnode);
25
27
  this.passThrough(span, xmlnode);
26
28
  };
@@ -16,7 +16,7 @@
16
16
 
17
17
  // From https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#phrasing_content
18
18
  // Note: 'a', 'del', 'ins', 'link', 'map', 'meta' have additional constraints that we ignore since they shouldn't occur in our content
19
- const phrasingContentTags = ['abbr', 'audio', 'b', 'bdo', 'br', 'button', 'canvas', 'cite', 'code', 'data', 'datalist', 'dfn', 'em', 'embed', 'i', 'iframe', 'img', 'input', 'kbd', 'label', 'mark', 'math', 'meter', 'noscript', 'object', 'output', 'picture', 'progress', 'q', 'ruby', 'samp', 'script', 'select', 'small', 'span', 'strong', 'sub', 'sup', 'svg', 'textarea', 'time', 'u', 'var', 'video', 'wbr', 'a', 'del', 'ins', 'link', 'map', 'meta']
19
+ const phrasingContentTags = ['abbr', 'audio', 'b', 'bdo', 'br', 'button', 'canvas', 'cite', 'code', 'data', 'datalist', 'dfn', 'em', 'embed', 'i', 'iframe', 'img', 'input', 'kbd', 'label', 'mark', 'math', 'meter', 'noscript', 'object', 'output', 'picture', 'progress', 'q', 'ruby', 'samp', 'script', 'select', 'small', 'span', 'strong', 'sub', 'sup', 'svg', 'textarea', 'time', 'u', 'var', 'video', 'wbr', 'a', 's', 'del', 'ins', 'link', 'map', 'meta']
20
20
 
21
21
  /**
22
22
  * Checks if node is an element that is not phrasing content.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amermathsoc/texml-to-html",
3
- "version": "20.1.0",
3
+ "version": "20.2.0",
4
4
  "type": "module",
5
5
  "description": "A NodeJS library for converting AMS-style JATS XML to HTML",
6
6
  "scripts": {
package/test/article.xml CHANGED
@@ -166,7 +166,7 @@
166
166
  <sc/>
167
167
  <monospace/>
168
168
  <underline/>
169
- <strike/>
169
+ <p>pre<strike/>post</p>
170
170
  <sans-serif/>
171
171
  <disp-quote specific-use="use">
172
172
  <p>Quote</p>
@@ -255,6 +255,7 @@
255
255
  </front-matter-part>
256
256
  <front-matter-part id="intro1" disp-level="1">
257
257
  <title>Introduction</title>
258
+ <attrib specific-use="aufm">The Author</attrib>
258
259
  </front-matter-part>
259
260
  <sec id="ack3" disp-level="1" specific-use="section">
260
261
  <title>Acknowledg</title>
@@ -20,8 +20,8 @@ import tape from 'tape';
20
20
 
21
21
 
22
22
  tape('Template: attrib', async function(t) {
23
- t.plan(1);
23
+ t.plan(2);
24
24
  const document = article;
25
25
  t.ok(document.querySelector('span[data-ams-doc="attribution"]'), 'attrib: span with data attribute');
26
+ t.ok(document.querySelector('span[data-ams-doc="attribution"][data-ams-specific-use="aufm"]'), 'attrib: specific-use');
26
27
  });
27
-
@@ -19,7 +19,7 @@ import tape from 'tape';
19
19
 
20
20
 
21
21
  tape('postProcessing.js', async function (t) {
22
- t.plan(4);
22
+ t.plan(5);
23
23
  const document = article;
24
24
 
25
25
  t.equal(document.querySelector('#contentModel-1').innerHTML.trim(), `<p>
@@ -41,5 +41,6 @@ tape('postProcessing.js', async function (t) {
41
41
  t.equal(document.querySelector('#contentModel-3').innerHTML.trim(), `<p>1</p><p>2</p><p>3</p>`, 'Paragraph with text+paragraph+text split into 3 paragraphs (snapshot)');
42
42
 
43
43
  t.equal(document.querySelector('cite-group').parentNode.tagName, 'P', 'Custom elements remain in paragraph');
44
- });
45
44
 
45
+ t.equal(document.querySelector('p:has(s)').innerHTML, `pre<s></s>post`, 's element is phrasing content');
46
+ });
@@ -153,7 +153,7 @@
153
153
  <span data-ams-style="sc"></span>
154
154
  <span data-ams-style="monospace"></span>
155
155
  <u></u>
156
- <s></s>
156
+ <p>pre<s></s>post</p>
157
157
  <span data-ams-style="sans-serif"></span>
158
158
  <blockquote data-ams-style="use">
159
159
  <p>Quote</p>
@@ -242,6 +242,7 @@
242
242
  </section>
243
243
  <section role="doc-introduction" id="intro1" data-ams-doc="null" data-ams-doc-level="0"><h1><span data-ams-doc="title">Introduction</span></h1>
244
244
 
245
+ <span data-ams-specific-use="aufm" data-ams-doc="attribution">The Author</span>
245
246
  </section>
246
247
  <section role="doc-acknowledgments" id="ack3" data-ams-doc="section" data-ams-doc-level="1"><h2><span data-ams-doc="title">Acknowledg</span></h2>
247
248
 
@@ -33,7 +33,7 @@
33
33
 
34
34
  <section id="ltxid3" data-ams-doc="section" data-ams-doc-level="1">
35
35
  <p>hello, world</p>
36
- <span data-ams-doc="attribution">John Doe<br>Miskatonic University</span>
36
+ <span data-ams-specific-use="aufm" data-ams-doc="attribution">John Doe<br>Miskatonic University</span>
37
37
  </section>
38
38
 
39
39
  </section></body></html>