@amermathsoc/texml-to-html 15.2.0 → 15.2.1
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 +2 -0
- package/lib/elements/label.js +4 -5
- package/lib/elements/sec.js +1 -1
- package/package.json +1 -1
- package/ldom.js +0 -6
- package/out.html +0 -550
- package/test/unit/abstract.js +0 -35
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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
|
+
### [15.2.1](https://github.com/AmerMathSoc/texml-to-html/compare/v15.2.0...v15.2.1) (2024-03-29)
|
|
6
|
+
|
|
5
7
|
## [15.2.0](https://github.com/AmerMathSoc/texml-to-html/compare/v15.1.1...v15.2.0) (2024-03-29)
|
|
6
8
|
|
|
7
9
|
|
package/lib/elements/label.js
CHANGED
|
@@ -41,8 +41,7 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
41
41
|
this.passThrough(htmlParentNode, xmlnode);
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
// CASE fig, fig-group, table-wrap, table-wrap-group via caption
|
|
45
|
-
// TODO: could we just return?
|
|
44
|
+
// CASE fig, fig-group, table-wrap, table-wrap-group via caption
|
|
46
45
|
if (
|
|
47
46
|
xmlnode.parentNode.tagName === 'table-wrap' ||
|
|
48
47
|
xmlnode.parentNode.tagName === 'table-wrap-group' ||
|
|
@@ -55,7 +54,7 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
55
54
|
// CASE label followed by a title -- we skip (and pull in the label later on when processing title)
|
|
56
55
|
if (xmlnode.nextElementSibling?.tagName === 'title') return;
|
|
57
56
|
// CASE empty label
|
|
58
|
-
if (xmlnode.tagName === 'label' && xmlnode.innerHTML.trim() === '') return;
|
|
57
|
+
if (xmlnode.tagName === 'label' && xmlnode.innerHTML.trim() === '') return;
|
|
59
58
|
|
|
60
59
|
// complex cases
|
|
61
60
|
|
|
@@ -79,7 +78,7 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
79
78
|
|
|
80
79
|
// Pull in label (if title+label and we're processing title)
|
|
81
80
|
const previousSibling = xmlnode.previousElementSibling;
|
|
82
|
-
if (previousSibling?.tagName === 'label' && previousSibling.innerHTML.trim() !== '') {
|
|
81
|
+
if (previousSibling?.tagName === 'label' && previousSibling.innerHTML.trim() !== '') {
|
|
83
82
|
const labelSpan = this.createNode('span', '', { 'data-ams-doc': 'label' });
|
|
84
83
|
container.appendChild(labelSpan);
|
|
85
84
|
this.passThrough(labelSpan, previousSibling);
|
|
@@ -99,6 +98,6 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
99
98
|
container.appendChild(actualSpan);
|
|
100
99
|
this.passThrough(actualSpan, xmlnode);
|
|
101
100
|
|
|
102
|
-
// faking TeX's punctutation-at-end logic
|
|
101
|
+
// faking TeX's punctutation-at-end logic
|
|
103
102
|
if (isStatement) container.insertAdjacentText('beforeend', container.textContent.endsWith('.') ? ' ' : '. ');
|
|
104
103
|
};
|
package/lib/elements/sec.js
CHANGED
|
@@ -77,7 +77,7 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
77
77
|
section.setAttribute('role', 'doc-introduction');
|
|
78
78
|
|
|
79
79
|
// book appendices
|
|
80
|
-
if (tagName === 'book-app-group'
|
|
80
|
+
if (tagName === 'book-app-group') {
|
|
81
81
|
// NOTE might become redundant if book-app-group gets specific-use=part
|
|
82
82
|
section.setAttribute('role', 'doc-part');
|
|
83
83
|
section.setAttribute('data-ams-doc', 'part');
|
package/package.json
CHANGED
package/ldom.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DOMParser } from 'linkedom';
|
|
2
|
-
|
|
3
|
-
const htmlDom = (new DOMParser).parseFromString('<!DOCTYPE html> <html><head><title></title></head><body><pre></pre></body></html>', 'text/html').defaultView.window.document;
|
|
4
|
-
|
|
5
|
-
htmlDom.querySelector('pre').insertAdjacentHTML('afterend' ,'hello')
|
|
6
|
-
console.log(htmlDom.body.outerHTML);
|
package/out.html
DELETED
|
@@ -1,550 +0,0 @@
|
|
|
1
|
-
Info: ams-xml-to-html: fixing non-phrasing in paragraph, cf. texml#104, near ID pid1
|
|
2
|
-
Info: ams-xml-to-html: fixing non-phrasing in paragraph, cf. texml#104, near ID hacks
|
|
3
|
-
Info: ams-xml-to-html: fixing non-phrasing in paragraph, cf. texml#104, near ID hacks
|
|
4
|
-
<!DOCTYPE html> <html dir="ltr" lang="en"><head><meta charset="utf-8"><meta content="width=device-width, initial-scale=1" name="viewport"><title>article-title</title></head><body><section data-ams-doc="article">
|
|
5
|
-
<section data-ams-doc="frontmatter"><script type="application/json">{
|
|
6
|
-
"title": "article-title",
|
|
7
|
-
"alttitle": "article-title",
|
|
8
|
-
"identifiers": {
|
|
9
|
-
"AMS": {
|
|
10
|
-
"manuscriptId": "manuscriptId",
|
|
11
|
-
"mr": "mr",
|
|
12
|
-
"pii": "pii"
|
|
13
|
-
},
|
|
14
|
-
"crossref": {
|
|
15
|
-
"doi": "doi"
|
|
16
|
-
},
|
|
17
|
-
"uri": {
|
|
18
|
-
"abstract": "href",
|
|
19
|
-
"pdf": "href"
|
|
20
|
-
},
|
|
21
|
-
"basename": "journalIdmanuscriptId",
|
|
22
|
-
"amsref": ""
|
|
23
|
-
},
|
|
24
|
-
"relatedArticles": {
|
|
25
|
-
"S0894-0347-2023-01025-2": {
|
|
26
|
-
"type": "erratum-forward",
|
|
27
|
-
"url": "https://www.ams.org/jams/2023-36-04/S0894-0347-2023-01025-2/",
|
|
28
|
-
"linkText": "J. Amer. Math. Soc. 36 (2023), 1305-1308."
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"publishers": [
|
|
32
|
-
{
|
|
33
|
-
"name": "publisher-name",
|
|
34
|
-
"location": "publisher-loc"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"contributors": {
|
|
38
|
-
"contribAs": [
|
|
39
|
-
{
|
|
40
|
-
"name": "Given Sur",
|
|
41
|
-
"bio": "",
|
|
42
|
-
"affiliations": [
|
|
43
|
-
"aff"
|
|
44
|
-
],
|
|
45
|
-
"emails": [
|
|
46
|
-
"email"
|
|
47
|
-
],
|
|
48
|
-
"mrauth": "mrauthid",
|
|
49
|
-
"orcid": "orcidid",
|
|
50
|
-
"uri": "uri",
|
|
51
|
-
"byline": "comment"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "Given2 Sur2",
|
|
55
|
-
"bio": "",
|
|
56
|
-
"affiliations": [
|
|
57
|
-
"aff"
|
|
58
|
-
],
|
|
59
|
-
"emails": [
|
|
60
|
-
"email"
|
|
61
|
-
],
|
|
62
|
-
"mrauth": "mrauthid",
|
|
63
|
-
"orcid": "orcidid",
|
|
64
|
-
"uri": "uri"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"contribBs": [
|
|
68
|
-
{
|
|
69
|
-
"name": "Given Sur Jr.",
|
|
70
|
-
"bio": "",
|
|
71
|
-
"affiliations": [
|
|
72
|
-
"<span>Address at time of publication:</span> Aff1",
|
|
73
|
-
"Aff2"
|
|
74
|
-
],
|
|
75
|
-
"emails": [
|
|
76
|
-
"address1",
|
|
77
|
-
"address2"
|
|
78
|
-
],
|
|
79
|
-
"mrauth": "mrauthid",
|
|
80
|
-
"orcid": "orcidid",
|
|
81
|
-
"uri": "uri",
|
|
82
|
-
"byline": "comment"
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"permissions": {
|
|
87
|
-
"copyrightStatement": ""
|
|
88
|
-
},
|
|
89
|
-
"journal": {
|
|
90
|
-
"title": "journal-title",
|
|
91
|
-
"identifiers": {
|
|
92
|
-
"AMS": {
|
|
93
|
-
"journalId": "journalId"
|
|
94
|
-
},
|
|
95
|
-
"issn": {
|
|
96
|
-
"print": "print",
|
|
97
|
-
"electronic": "electronic"
|
|
98
|
-
},
|
|
99
|
-
"uri": ""
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"customMeta": {
|
|
103
|
-
"communicated-by": "meta-value",
|
|
104
|
-
"titlepic": "<img alt=\"Graphic without alt text\" data-ams-height=\"218pt\" data-ams-width=\"493pt\" data-ams-style=\"null\" src=\"Images/imgc920fa78a62d5705041ab0ad31b3c7df.svg\" data-ams-doc=\"inline-graphic\">"
|
|
105
|
-
},
|
|
106
|
-
"categories": {},
|
|
107
|
-
"byline": "comment Given Sur and Given2 Sur2, comment Given Sur Jr.",
|
|
108
|
-
"volumeInfo": {
|
|
109
|
-
"volume": "volume",
|
|
110
|
-
"issue": "issue"
|
|
111
|
-
},
|
|
112
|
-
"history": {
|
|
113
|
-
"published": "2000-04-13",
|
|
114
|
-
"received": "1999-09-15",
|
|
115
|
-
"rev-recd": [
|
|
116
|
-
"2000-07-01",
|
|
117
|
-
"2000-07-02"
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
"msc": {
|
|
121
|
-
"vocab": "MSC scheme",
|
|
122
|
-
"vocabUrl": "https://mathscinet.ams.org/msc/msc2020.html?t=",
|
|
123
|
-
"primary": [
|
|
124
|
-
"key1",
|
|
125
|
-
"key2"
|
|
126
|
-
],
|
|
127
|
-
"secondary": [
|
|
128
|
-
"key3",
|
|
129
|
-
"key4"
|
|
130
|
-
]
|
|
131
|
-
},
|
|
132
|
-
"keywords": []
|
|
133
|
-
}</script>
|
|
134
|
-
<h1>article-title</h1>
|
|
135
|
-
<section role="doc-dedication" data-ams-content-type="dedication" data-ams-doc="notes"></section><section role="doc-abstract" data-ams-doc-level="1">
|
|
136
|
-
<h2>Abstract</h2>
|
|
137
|
-
</section><ul data-ams-doc="MSC scheme">
|
|
138
|
-
<li data-msc-key="key1" data-msc-role="primary">Formal groups, <span data-ams-doc="math inline"><tex-math>p</tex-math></span>-divisible groups</li>
|
|
139
|
-
<li data-msc-key="key2" data-msc-role="primary">desc2</li>
|
|
140
|
-
<li data-msc-key="key3" data-msc-role="secondary">desc3</li>
|
|
141
|
-
<li data-msc-key="key4" data-msc-role="secondary">desc4</li>
|
|
142
|
-
</ul><ul data-ams-doc="keywords">
|
|
143
|
-
<li>keyword</li>
|
|
144
|
-
</ul><div data-ams-doc="funding-group">
|
|
145
|
-
<p>Funding 1</p>
|
|
146
|
-
<p>Funding 2.</p>
|
|
147
|
-
</div></section>
|
|
148
|
-
|
|
149
|
-
<section id="sec" data-ams-doc="section" data-ams-doc-level="1">
|
|
150
|
-
<span data-ams-style="type"></span>
|
|
151
|
-
<i></i>
|
|
152
|
-
<em></em>
|
|
153
|
-
<strong></strong>
|
|
154
|
-
<span data-ams-style="roman"></span>
|
|
155
|
-
<span data-ams-style="sc"></span>
|
|
156
|
-
<span data-ams-style="monospace"></span>
|
|
157
|
-
<u></u>
|
|
158
|
-
<span data-ams-style="sans-serif"></span>
|
|
159
|
-
<blockquote data-ams-style="use">
|
|
160
|
-
<footer> <span></span></footer>
|
|
161
|
-
</blockquote>
|
|
162
|
-
<div data-ams-content-type="framed" data-ams-style="boxed">
|
|
163
|
-
<p>A boxed paragraph from framed input</p>
|
|
164
|
-
</div>
|
|
165
|
-
<div data-ams-style-color="background-color:lightgray;border-color:black;border-width:medium;border-style:solid;" data-ams-content-type="tcolorbox" data-ams-style="boxed">
|
|
166
|
-
<p>A boxed paragraph from tcolorbox input</p>
|
|
167
|
-
</div>
|
|
168
|
-
<p>
|
|
169
|
-
|
|
170
|
-
</p><blockquote data-ams-style="use">
|
|
171
|
-
<footer> <span></span></footer>
|
|
172
|
-
</blockquote>
|
|
173
|
-
<p>
|
|
174
|
-
|
|
175
|
-
</p><blockquote role="doc-epigraph">
|
|
176
|
-
<footer> <span></span></footer>
|
|
177
|
-
</blockquote>
|
|
178
|
-
<figure id="figattrib" data-ams-doc="fig">
|
|
179
|
-
<figcaption>Caption <span>Attrib</span></figcaption>
|
|
180
|
-
|
|
181
|
-
</figure>
|
|
182
|
-
<a data-ams-ref="type" href="#rid1">ref</a>
|
|
183
|
-
<a role="doc-noteref" data-ams-ref="fn" href="#rid2"><sup>ref</sup></a>
|
|
184
|
-
<cite><a role="doc-biblioref" data-ams-ref="bibr" href="#rid3">ref</a></cite>
|
|
185
|
-
<cite><a role="doc-biblioref" data-ams-ref="bibr" href="#rid4">ref, note</a></cite>
|
|
186
|
-
<a data-ams-ref="type" href="#rid5">Context ref</a>
|
|
187
|
-
<span data-ams-ref="notrid">ref</span>
|
|
188
|
-
<a data-ams-ref="nested" href="#rid6"></a><span><a href="https://nested"></a></span>
|
|
189
|
-
<a href="https://nested2"></a><span><a data-ams-ref="nested" href="#rid6"></a></span>
|
|
190
|
-
<div aria-label="Footnote Label" role="doc-footnote"><span data-ams-doc="label"><sup>Label</sup></span></div>
|
|
191
|
-
<p id="pwithx">Is ignored.</p>
|
|
192
|
-
|
|
193
|
-
<p></p>
|
|
194
|
-
<dl id="pid2">
|
|
195
|
-
<div>
|
|
196
|
-
<dt id="term1">•</dt>
|
|
197
|
-
<dd><p></p></dd>
|
|
198
|
-
</div>
|
|
199
|
-
</dl>
|
|
200
|
-
<div id="pid3" aria-label="Footnote " role="doc-footnote"><span data-ams-doc="label"><sup></sup></span><p></p></div>
|
|
201
|
-
<dl data-ams-content-type="itemize" id="dlist1">
|
|
202
|
-
<div>
|
|
203
|
-
<dt id="ditem1">•</dt>
|
|
204
|
-
<dd><p>Item 1</p></dd>
|
|
205
|
-
</div>
|
|
206
|
-
</dl>
|
|
207
|
-
<a href="https://"></a>
|
|
208
|
-
<figure data-ams-doc="table-wrap">
|
|
209
|
-
|
|
210
|
-
<figcaption><strong>Table 1. </strong>Caption</figcaption>
|
|
211
|
-
<div data-ams-doc="table-wrap"><table class="tbl"><thead><tr><th>Head 1</th><th>Head 2</th></tr></thead><tbody><tr><td colspan="1" rowspan="2" id="tdattributes"></td><td hidden="true"></td></tr></tbody></table></div>
|
|
212
|
-
</figure>
|
|
213
|
-
<figure data-ams-doc="table-wrap-group">
|
|
214
|
-
|
|
215
|
-
<figcaption><strong>Table with subtables. </strong>Caption</figcaption>
|
|
216
|
-
<figure data-ams-doc="table-wrap">
|
|
217
|
-
|
|
218
|
-
<figcaption><strong>(a) </strong>Sub-caption</figcaption>
|
|
219
|
-
<div data-ams-doc="table-wrap"><table class="tbl"></table></div>
|
|
220
|
-
</figure>
|
|
221
|
-
<figure data-ams-doc="table-wrap">
|
|
222
|
-
|
|
223
|
-
<figcaption><strong>(b) </strong>Sub-caption</figcaption>
|
|
224
|
-
<div data-ams-doc="table-wrap"><table class="tbl"></table></div>
|
|
225
|
-
</figure>
|
|
226
|
-
</figure>
|
|
227
|
-
<br>
|
|
228
|
-
<span data-ams-doc="stringname"></span>
|
|
229
|
-
<span id="target"></span>
|
|
230
|
-
<figure data-ams-doc="verse-group"></figure>
|
|
231
|
-
<figure id="emptyLabel" data-ams-doc="statement">
|
|
232
|
-
|
|
233
|
-
</figure>
|
|
234
|
-
<figure id="titleEmptyLabel" data-ams-doc="statement">
|
|
235
|
-
|
|
236
|
-
<figcaption>Title. </figcaption>
|
|
237
|
-
</figure>
|
|
238
|
-
<sup>1</sup>
|
|
239
|
-
<sub>1</sub>
|
|
240
|
-
<pre>preformatted</pre>
|
|
241
|
-
<hr>
|
|
242
|
-
</section>
|
|
243
|
-
|
|
244
|
-
<section role="doc-acknowledgments" id="ack1" data-ams-doc="null" data-ams-doc-level="1">
|
|
245
|
-
</section>
|
|
246
|
-
<section role="doc-acknowledgments" id="ack2" data-ams-doc="null" data-ams-doc-level="0">
|
|
247
|
-
<h1>Acknowledg</h1>
|
|
248
|
-
</section>
|
|
249
|
-
<section role="doc-introduction" id="intro1" data-ams-doc="null" data-ams-doc-level="0">
|
|
250
|
-
<h1>Introduction</h1>
|
|
251
|
-
</section>
|
|
252
|
-
<section role="doc-acknowledgments" id="ack3" data-ams-doc="section" data-ams-doc-level="1">
|
|
253
|
-
<h2>Acknowledg</h2>
|
|
254
|
-
</section>
|
|
255
|
-
<section role="doc-introduction" id="intro2" data-ams-doc="section" data-ams-doc-level="1">
|
|
256
|
-
<h2>Introduction</h2>
|
|
257
|
-
</section>
|
|
258
|
-
|
|
259
|
-
<section role="doc-dedication" id="ded" data-ams-doc="null" data-ams-doc-level="0"></section>
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
<section id="subsec" data-ams-doc="subsection" data-ams-doc-level="2">
|
|
263
|
-
<h3>Subsection</h3>
|
|
264
|
-
</section>
|
|
265
|
-
<section id="seclabeltitle" data-ams-doc="section" data-ams-doc-level="1">
|
|
266
|
-
|
|
267
|
-
<h2><span data-ams-doc="label">Label. </span>Title</h2>
|
|
268
|
-
</section>
|
|
269
|
-
<section id="seclabel" data-ams-doc="section" data-ams-doc-level="1">
|
|
270
|
-
<header><h2>Label</h2><p data-ams-doc="subtitle">Subtitle</p></header>
|
|
271
|
-
<p data-ams-doc="subtitle">Subtitle</p>
|
|
272
|
-
</section>
|
|
273
|
-
<section id="sectitle" data-ams-doc="section" data-ams-doc-level="1">
|
|
274
|
-
<header><h2>Title</h2><p data-ams-doc="subtitle">Subtitle</p></header>
|
|
275
|
-
<p data-ams-doc="subtitle">Subtitle</p>
|
|
276
|
-
</section>
|
|
277
|
-
<section id="refhead" data-ams-doc="refhead" data-ams-doc-level="1">
|
|
278
|
-
<h2>Refhead</h2>
|
|
279
|
-
</section>
|
|
280
|
-
|
|
281
|
-
<section id="statements" data-ams-doc="section" data-ams-doc-level="1">
|
|
282
|
-
<figure data-ams-style="style" data-ams-content-type="content type" id="statement1" data-ams-doc="statement">
|
|
283
|
-
|
|
284
|
-
<figcaption><span data-ams-doc="label">Label 1 </span>Title 1. </figcaption>
|
|
285
|
-
<p></p>
|
|
286
|
-
</figure>
|
|
287
|
-
<figure data-ams-style="style" data-ams-content-type="content type" id="statement2" data-ams-doc="statement">
|
|
288
|
-
<figcaption>Label 2. </figcaption>
|
|
289
|
-
<p></p>
|
|
290
|
-
</figure>
|
|
291
|
-
<figure data-ams-style="style" data-ams-content-type="content type" id="statement3" data-ams-doc="statement">
|
|
292
|
-
<figcaption>Title 3. </figcaption>
|
|
293
|
-
<p></p>
|
|
294
|
-
</figure>
|
|
295
|
-
<figure data-ams-style="style" data-ams-content-type="content type" id="statement-title-period" data-ams-doc="statement">
|
|
296
|
-
<figcaption>Title 4. </figcaption>
|
|
297
|
-
<p></p>
|
|
298
|
-
</figure>
|
|
299
|
-
<figure data-ams-qed-box="true" data-ams-content-type="proof proof" id="statement4" data-ams-doc="statement">
|
|
300
|
-
<figcaption>Proof. </figcaption>
|
|
301
|
-
<span data-ams-specific-use="subsection" id="statement4secheading" data-ams-doc-level="2" data-ams-doc="secheading">secheading</span>
|
|
302
|
-
</figure>
|
|
303
|
-
<figure data-ams-qed-box="true" data-ams-content-type="proof proof" id="statement5" data-ams-doc="statement">
|
|
304
|
-
|
|
305
|
-
<figcaption><span data-ams-doc="label">Label 5 </span>Proof. </figcaption>
|
|
306
|
-
<span data-ams-specific-use="subsection" id="statement5secheading" data-ams-doc-level="2" data-ams-doc="secheading">secheading</span>
|
|
307
|
-
</figure>
|
|
308
|
-
<figure data-ams-qed-box="true" data-ams-content-type="proof proof" id="statement6" data-ams-doc="statement">
|
|
309
|
-
<span data-ams-specific-use="subsection" id="statement6secheading" data-ams-doc-level="2" data-ams-doc="secheading">Label 6. secheading</span>
|
|
310
|
-
</figure>
|
|
311
|
-
<figure data-ams-qed-box="true" data-ams-content-type="proof proof" id="statement7" data-ams-doc="statement">
|
|
312
|
-
<figure data-ams-style="style" data-ams-content-type="content type" id="statement8" data-ams-doc="statement">
|
|
313
|
-
<figcaption>Nested Theorem. </figcaption>
|
|
314
|
-
</figure>
|
|
315
|
-
</figure>
|
|
316
|
-
<dl id="statementlist">
|
|
317
|
-
<div>
|
|
318
|
-
<dt id="statementlistterm">•</dt>
|
|
319
|
-
<dd>
|
|
320
|
-
<figure data-ams-style="style" data-ams-content-type="content type" id="statement9" data-ams-doc="statement">
|
|
321
|
-
|
|
322
|
-
<figcaption><span data-ams-doc="label">Label 1 </span>Title 1. </figcaption>
|
|
323
|
-
<p></p>
|
|
324
|
-
</figure>
|
|
325
|
-
</dd>
|
|
326
|
-
</div>
|
|
327
|
-
</dl>
|
|
328
|
-
</section>
|
|
329
|
-
|
|
330
|
-
<section id="figures" data-ams-doc="section" data-ams-doc-level="1">
|
|
331
|
-
<figure id="position" data-ams-position="anchor" data-ams-doc="fig">
|
|
332
|
-
|
|
333
|
-
<figcaption><strong>Label 1. </strong>Caption 1</figcaption>
|
|
334
|
-
</figure>
|
|
335
|
-
<figure data-ams-specific-use="special" data-ams-doc="fig-group">
|
|
336
|
-
|
|
337
|
-
<figcaption><strong>Grouplabel 1. </strong>Groupcaption 1</figcaption>
|
|
338
|
-
<figure data-ams-doc="fig">
|
|
339
|
-
|
|
340
|
-
<figcaption><strong>(Sublabel 1) </strong>Subcaption 1</figcaption>
|
|
341
|
-
</figure>
|
|
342
|
-
</figure>
|
|
343
|
-
<figure data-ams-doc="fig">
|
|
344
|
-
<figcaption><strong>Label 2. </strong></figcaption>
|
|
345
|
-
</figure>
|
|
346
|
-
<figure data-ams-doc="fig-group">
|
|
347
|
-
<figcaption><strong>Grouplabel 2. </strong></figcaption>
|
|
348
|
-
<figure data-ams-doc="fig">
|
|
349
|
-
<figcaption><strong>(Sublabel 2) </strong></figcaption>
|
|
350
|
-
</figure>
|
|
351
|
-
</figure>
|
|
352
|
-
</section>
|
|
353
|
-
|
|
354
|
-
<section id="graphics" data-ams-doc="section" data-ams-doc-level="1">
|
|
355
|
-
<figure data-ams-doc="fig">
|
|
356
|
-
<img alt="text" data-ams-height="100pt" data-ams-width="100px" data-ams-style="use" src="file" data-ams-doc="graphic">
|
|
357
|
-
|
|
358
|
-
</figure>
|
|
359
|
-
<img alt="Graphic without alt text" data-ams-height="height" data-ams-width="width" data-ams-style="use" src="file" data-ams-doc="inline-graphic">
|
|
360
|
-
<img alt="text" src="file">
|
|
361
|
-
</section>
|
|
362
|
-
|
|
363
|
-
<section id="equations" data-ams-doc="section" data-ams-doc-level="1">
|
|
364
|
-
<p>
|
|
365
|
-
<span data-ams-doc="math inline"> <tex-math>\text{Te\#t }\xhref[fn]{#fnid1}{{}^{1}}\xhref[other]{#otherid1}{}</tex-math> </span>
|
|
366
|
-
</p><div id="fnid" aria-label="Footnote 1" role="doc-footnote"><span data-ams-doc="label"><sup>1</sup></span><p><a role="doc-noteref" data-ams-ref="fn" href="#fnid1"><sup>1</sup></a></p></div>
|
|
367
|
-
<span data-ams-qed-box="true" data-ams-doc="math block"><tex-math>\xhref[fn]{#fnid2}{{}^{2}}\text{Start\xhref[other]{#otherid2}{\$}End}</tex-math></span><div id="fnid2" aria-label="Footnote " role="doc-footnote"><span data-ams-doc="label"><sup></sup></span></div>
|
|
368
|
-
<span data-ams-doc="math block"> <tex-math> \text{\textrm{roman\#} $\mathsc{sc\$}$ \textit{italic\_} \textbf{bold\$} \textsf{sans-serif\&} \texttt{monospace} \href{https://ext~}{ext-link\unicode{x7E}} inside text} </tex-math> </span>
|
|
369
|
-
<div data-ams-doc="math text"><span id="C" data-ams-doc="label">(X<span data-ams-doc="math inline"><tex-math>X</tex-math></span>X)</span>
|
|
370
|
-
<p>Tagged equation.</p>
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
</div>
|
|
375
|
-
<figure id="disp-formula-group" data-ams-content-type="disp-formula-group" data-ams-doc="statement">
|
|
376
|
-
<figcaption>Formula Group</figcaption>
|
|
377
|
-
<span data-ams-doc="math block"><tex-math>x</tex-math></span>
|
|
378
|
-
</figure>
|
|
379
|
-
<p>
|
|
380
|
-
<span data-ams-doc="math inline"> <tex-math>\text{Te\$t$x^2$}</tex-math> </span>
|
|
381
|
-
</p>
|
|
382
|
-
<span data-ams-doc="math block"> <tex-math> x = \vcenter{\img[][12pt][12pt][{Graphic without alt text}]{Images/test.svg}} </tex-math> </span>
|
|
383
|
-
|
|
384
|
-
<span data-ams-doc="math block"><tex-math>\xhref[fn]{#fnid5}{{}^{5}}y</tex-math></span><div id="fnid5" aria-label="Footnote " role="doc-footnote"><span data-ams-doc="label"><sup></sup></span><span data-ams-doc="math inline"><tex-math>x</tex-math></span></div>
|
|
385
|
-
|
|
386
|
-
<span data-ams-doc="math block"><tex-math>\tag{$x$}</tex-math></span>
|
|
387
|
-
|
|
388
|
-
<span data-ams-doc="math block"><span hidden data-ams-doc="tags"><span><span data-ams-doc="math inline"><tex-math>x</tex-math></span></span></span><tex-math data-ams-tags="["$x$"]">\cssId{targetMath}{_\tag{$x$}}</tex-math></span>
|
|
389
|
-
|
|
390
|
-
<span data-ams-doc="math block"><span hidden data-ams-doc="tags"><span>PlainTag</span><span><span data-ams-doc="math inline"><tex-math>\mathbb{N}</tex-math></span></span><span>TextTag</span></span><tex-math data-ams-tags="["PlainTag","$\\mathbb{N}$","TextTag"]">\tag{PlainTag}\cssId{targetMath2}{\tag{$\mathbb{N}$}}\cssId{targetMath3}{\tag{TextTag}}</tex-math></span>
|
|
391
|
-
<span data-ams-doc="math block"><tex-math>\tag*{tag*}</tex-math></span>
|
|
392
|
-
<div data-ams-doc="math text"><span id="textEquation" data-ams-doc="label">(T)</span>
|
|
393
|
-
<p>Some lengthy complex text fragment.</p>
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
</div>
|
|
398
|
-
</section>
|
|
399
|
-
|
|
400
|
-
<section id="citegroup" data-ams-doc="section" data-ams-doc-level="1">
|
|
401
|
-
<a data-ams-ref="type" href="#rid1">ref</a><a role="doc-noteref" data-ams-ref="fn" href="#rid2"><sup>ref</sup></a>
|
|
402
|
-
</section>
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
<section id="alttitle" data-ams-doc="section" data-ams-doc-level="1">
|
|
406
|
-
<h2>Title</h2>
|
|
407
|
-
|
|
408
|
-
</section>
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
<section id="styled_color" data-ams-doc="section" data-ams-doc-level="1">
|
|
412
|
-
<h2>Color</h2>
|
|
413
|
-
<span data-ams-style-color="color:Teal;background-color:rgb(0.000%, 0.000%, 1.000%);border-color:rgb(0, 140, 10);border-width:thin;border-style:solid;">Styled content with color</span>
|
|
414
|
-
</section>
|
|
415
|
-
|
|
416
|
-
<p id="multifootnotes">
|
|
417
|
-
<a role="doc-noteref" data-ams-ref="fn" href="#fnid3"><sup>4</sup></a>
|
|
418
|
-
<a role="doc-noteref" data-ams-ref="fn" href="#fnid4"><sup>4</sup></a>
|
|
419
|
-
</p><div id="fnid3" aria-label="Footnote 3" role="doc-footnote"><span data-ams-doc="label"><sup>3</sup></span><p>Footnote 3</p></div><div id="fnid4" aria-label="Footnote 4" role="doc-footnote"><span data-ams-doc="label"><sup>4</sup></span><p>Footnote 4</p></div>
|
|
420
|
-
<section id="alg:algorithm" data-ams-doc="section" data-ams-doc-level="1">
|
|
421
|
-
<h2>Algorithm sample</h2>
|
|
422
|
-
<alg-algorithm data-ams-alg-linenodelimiter=":">
|
|
423
|
-
<alg-lineno></alg-lineno><alg-line data-ams-alg-spanslineno="">
|
|
424
|
-
<alg-statement>
|
|
425
|
-
<strong>Require:</strong> something</alg-statement>
|
|
426
|
-
</alg-line>
|
|
427
|
-
<alg-lineno></alg-lineno><alg-line>
|
|
428
|
-
<alg-statement>Statement</alg-statement>
|
|
429
|
-
<alg-comment>Comment
|
|
430
|
-
</alg-comment></alg-line>
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
<alg-lineno></alg-lineno><alg-line>
|
|
434
|
-
<alg-statement>
|
|
435
|
-
<strong>if</strong> condition <strong>then</strong></alg-statement>
|
|
436
|
-
</alg-line>
|
|
437
|
-
|
|
438
|
-
<alg-block data-ams-alg-blocklevel="1">
|
|
439
|
-
<alg-lineno>3:</alg-lineno><alg-line>
|
|
440
|
-
<alg-statement>true</alg-statement>
|
|
441
|
-
</alg-line>
|
|
442
|
-
</alg-block>
|
|
443
|
-
|
|
444
|
-
<alg-lineno>6:</alg-lineno><alg-line>
|
|
445
|
-
<alg-statement>
|
|
446
|
-
<strong>else</strong>
|
|
447
|
-
</alg-statement>
|
|
448
|
-
</alg-line>
|
|
449
|
-
<alg-block data-ams-alg-blocklevel="1">
|
|
450
|
-
<alg-lineno></alg-lineno><alg-line>
|
|
451
|
-
<alg-statement>false</alg-statement>
|
|
452
|
-
</alg-line>
|
|
453
|
-
<alg-block data-ams-alg-blocklevel="2">
|
|
454
|
-
<alg-lineno>8:</alg-lineno><alg-line>
|
|
455
|
-
<alg-statement>Nested for loop</alg-statement>
|
|
456
|
-
</alg-line>
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
<alg-lineno>9:</alg-lineno><alg-line>
|
|
460
|
-
<alg-statement>
|
|
461
|
-
<strong>for</strong> condition <strong>do</strong></alg-statement>
|
|
462
|
-
</alg-line>
|
|
463
|
-
|
|
464
|
-
<alg-block data-ams-alg-blocklevel="3">
|
|
465
|
-
<alg-lineno>10:</alg-lineno><alg-line>
|
|
466
|
-
<alg-statement>loop</alg-statement>
|
|
467
|
-
</alg-line>
|
|
468
|
-
</alg-block>
|
|
469
|
-
<alg-lineno></alg-lineno><alg-line>
|
|
470
|
-
<alg-statement>
|
|
471
|
-
<strong>end</strong> <strong>for</strong></alg-statement>
|
|
472
|
-
</alg-line>
|
|
473
|
-
|
|
474
|
-
</alg-block>
|
|
475
|
-
</alg-block>
|
|
476
|
-
|
|
477
|
-
<alg-lineno></alg-lineno><alg-line>
|
|
478
|
-
<alg-statement><strong>end</strong> <strong>if</strong></alg-statement>
|
|
479
|
-
</alg-line>
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
<alg-lineno></alg-lineno><alg-line><alg-statement><strong>Function</strong> <span data-ams-style="sc">Check</span></alg-statement></alg-line>
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
<alg-lineno></alg-lineno><alg-line><alg-statement><strong>Procedure</strong> <span data-ams-style="sc">Do</span></alg-statement></alg-line>
|
|
486
|
-
|
|
487
|
-
</alg-algorithm>
|
|
488
|
-
</section>
|
|
489
|
-
<section id="null" data-ams-doc="null" data-ams-doc-level="0">
|
|
490
|
-
<p>Email <a href="mailto://email">email</a> in content, not metadata.</p>
|
|
491
|
-
</section>
|
|
492
|
-
<section id="hacks" data-ams-doc="null" data-ams-doc-level="0">
|
|
493
|
-
|
|
494
|
-
<p>
|
|
495
|
-
text node
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
</p><dl>
|
|
499
|
-
<div>
|
|
500
|
-
<dt>1</dt>
|
|
501
|
-
<dd><p></p></dd>
|
|
502
|
-
</div>
|
|
503
|
-
</dl><dl>
|
|
504
|
-
<div>
|
|
505
|
-
<dt>2</dt>
|
|
506
|
-
<dd><p></p></dd>
|
|
507
|
-
</div>
|
|
508
|
-
</dl>
|
|
509
|
-
|
|
510
|
-
<dl>
|
|
511
|
-
</dl>
|
|
512
|
-
</section>
|
|
513
|
-
<section id="xrefgroup" data-ams-doc="null" data-ams-doc-level="0">
|
|
514
|
-
<p>See groups <span data-ams-refrange="xrefgroup2 xrefgroup3" data-ams-ref="grp" data-ams-doc="refgroup"><a data-ams-ref="grp" href="#xrefgroup1">2</a>–<a data-ams-ref="grp" href="#xrefgroup4">5</a></span></p>
|
|
515
|
-
</section>
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
<section role="doc-acknowledgments" id="ack1" data-ams-doc="null" data-ams-doc-level="1">
|
|
521
|
-
<h2></h2>
|
|
522
|
-
</section>
|
|
523
|
-
<section data-ams-specific-use="section" id="applabeltitle" data-ams-doc-level="1" role="doc-appendix">
|
|
524
|
-
|
|
525
|
-
<h2><span data-ams-doc="label">Label. </span>Title</h2>
|
|
526
|
-
</section>
|
|
527
|
-
<section data-ams-specific-use="section" id="applabel" data-ams-doc-level="1" role="doc-appendix">
|
|
528
|
-
<header><h2>Label</h2><p data-ams-doc="subtitle">Subtitle</p></header>
|
|
529
|
-
<p data-ams-doc="subtitle">Subtitle</p>
|
|
530
|
-
</section>
|
|
531
|
-
<section data-ams-specific-use="section" id="apptitle" data-ams-doc-level="1" role="doc-appendix">
|
|
532
|
-
<header><h2>Title</h2><p data-ams-doc="subtitle">Subtitle</p></header>
|
|
533
|
-
<p data-ams-doc="subtitle">Subtitle</p>
|
|
534
|
-
</section>
|
|
535
|
-
|
|
536
|
-
<section data-ams-specific-use="section" id="secmeta" data-ams-doc-level="1" role="doc-appendix">
|
|
537
|
-
|
|
538
|
-
<h2><span data-ams-doc="label">Appendix 1. </span>A criterion for kitchen representations</h2>
|
|
539
|
-
<section data-ams-byline="GivenName Surname" data-ams-contributors="{"authors":[{"name":"GivenName Surname","bio":"","affiliations":[],"emails":[]}]}" data-ams-doc="sec-meta">
|
|
540
|
-
|
|
541
|
-
</section>
|
|
542
|
-
</section>
|
|
543
|
-
<section data-ams-specific-use="section" id="appack" data-ams-doc-level="1" role="doc-acknowledgments">
|
|
544
|
-
<h2>Acknowledg</h2>
|
|
545
|
-
</section>
|
|
546
|
-
|
|
547
|
-
<section role="doc-bibliography" data-ams-content-type="biblist" id="reflist" data-ams-doc-level="1"><h2>References</h2><dl><dt id="ref">Label</dt><dd><div data-ams-doc="biblioentry">Mixed<code data-ams-doc="amsref">Raw</code></div></dd><dt id="refnolabel"></dt><dd><div data-ams-doc="biblioentry">Mixed</div></dd></dl></section>
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
</section></body></html>
|
package/test/unit/abstract.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2023 American Mathematical Society
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import tape from 'tape';
|
|
19
|
-
import { Transformer } from '../../lib/transformer.js';
|
|
20
|
-
import { xmlDom, htmlDom } from '../../lib/doms.js';
|
|
21
|
-
|
|
22
|
-
const xml = xmlDom('<root><abstract></abstract></root>');
|
|
23
|
-
const xmldoc = xml.window.document;
|
|
24
|
-
|
|
25
|
-
const html = htmlDom();
|
|
26
|
-
const htmldoc = html.window.document;
|
|
27
|
-
|
|
28
|
-
const transformer = new Transformer(htmldoc);
|
|
29
|
-
|
|
30
|
-
tape('Unit test: abstract.js', async function (t) {
|
|
31
|
-
t.plan(1);
|
|
32
|
-
transformer.abstract(htmldoc.body, xmldoc.querySelector('abstract'))
|
|
33
|
-
t.equal(htmldoc.body.innerHTML, '', 'Abstract');
|
|
34
|
-
});
|
|
35
|
-
|