@amermathsoc/texml-to-html 15.2.0 → 16.1.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 +27 -0
- package/README.md +2 -0
- package/lib/elements/book-meta-json.js +4 -0
- package/lib/elements/ext-link.js +11 -8
- package/lib/elements/label.js +4 -5
- package/lib/elements/sec.js +1 -1
- package/lib/elements/toc-entry.js +1 -0
- package/lib/elements/x.js +1 -1
- package/lib/elements/xref.js +25 -19
- package/lib/transformer.js +3 -2
- package/package.json +1 -1
- package/test/article.xml +2 -2
- package/test/book-meta-snapshot.json +3 -0
- package/test/book.xml +7 -1
- package/test/{element-citegroup.js → element-cite-detail.js} +3 -3
- package/test/element-cite-group.js +27 -0
- package/test/element-ext-link.js +2 -3
- package/test/element-toc-toc-entry.js +3 -3
- package/test/element-xref.js +2 -3
- package/ldom.js +0 -6
- package/lib/helpers/unnest.js +0 -34
- package/out.html +0 -550
- package/test/unit/abstract.js +0 -35
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
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
|
+
## [16.1.0](https://github.com/AmerMathSoc/texml-to-html/compare/v16.0.0...v16.1.0) (2024-06-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **book-meta.json.js:** preserve LCCN if present ([4426d63](https://github.com/AmerMathSoc/texml-to-html/commit/4426d632aa0e804ac516b39aea62186aa2c32751)), closes [#440](https://github.com/AmerMathSoc/texml-to-html/issues/440)
|
|
11
|
+
* support cite-group and cite-detail ([dc832cf](https://github.com/AmerMathSoc/texml-to-html/commit/dc832cf7a4b002a8c6dc3725df34b814a306239a)), closes [#443](https://github.com/AmerMathSoc/texml-to-html/issues/443)
|
|
12
|
+
* **toc-entry.js:** support specific-use attribute ([b11a3c9](https://github.com/AmerMathSoc/texml-to-html/commit/b11a3c955bc1601b425612a0a9ede0213e163bdd)), closes [#444](https://github.com/AmerMathSoc/texml-to-html/issues/444)
|
|
13
|
+
|
|
14
|
+
## [16.0.0](https://github.com/AmerMathSoc/texml-to-html/compare/v15.2.1...v16.0.0) (2024-04-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### ⚠ BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* Nested `a` are now "flattened" to `span`.
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* revise treatment of nested links ([cdc63a9](https://github.com/AmerMathSoc/texml-to-html/commit/cdc63a970cc14c87ae6faa115ae2484bb03fe339)), closes [#442](https://github.com/AmerMathSoc/texml-to-html/issues/442)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **xref.js:** warn on nested link not inside toc-entry ([a59b69e](https://github.com/AmerMathSoc/texml-to-html/commit/a59b69e205cc9296d65668e364040995144e564e)), closes [#442](https://github.com/AmerMathSoc/texml-to-html/issues/442)
|
|
29
|
+
|
|
30
|
+
### [15.2.1](https://github.com/AmerMathSoc/texml-to-html/compare/v15.2.0...v15.2.1) (2024-03-29)
|
|
31
|
+
|
|
5
32
|
## [15.2.0](https://github.com/AmerMathSoc/texml-to-html/compare/v15.1.1...v15.2.0) (2024-03-29)
|
|
6
33
|
|
|
7
34
|
|
package/README.md
CHANGED
|
@@ -149,6 +149,8 @@ Beyond HTML element and attributes, texml-to-html stores data in custom `data-*`
|
|
|
149
149
|
- graphic | inline-graphic @height
|
|
150
150
|
- data-ams-doc-alttitle
|
|
151
151
|
- alt-title (book only, for sectioning content only)
|
|
152
|
+
- data-ams-href
|
|
153
|
+
- stores href for span that avoids a nested link (cf. xref, ext-link)
|
|
152
154
|
|
|
153
155
|
##### downstream `data-*` attributes
|
|
154
156
|
|
|
@@ -34,6 +34,9 @@ const bookMetaJson =
|
|
|
34
34
|
// google: '',
|
|
35
35
|
// print: '',
|
|
36
36
|
// softcover: '',
|
|
37
|
+
},
|
|
38
|
+
loc: {
|
|
39
|
+
// llcn
|
|
37
40
|
}
|
|
38
41
|
},
|
|
39
42
|
title: '', // NOTE might contain math (but no use case yet)
|
|
@@ -87,6 +90,7 @@ export function generateBookJson(bookMetaNode) {
|
|
|
87
90
|
bookMetaJson.book.identifiers.AMS.publKey = bookMetaNode.querySelector('book-id[assigning-authority="AMS"][book-id-type="publisher"]')?.textContent;
|
|
88
91
|
bookMetaJson.book.identifiers.AMS.volumeId = bookMetaNode.querySelector('book-id[assigning-authority="AMS"][book-id-type="volume_id"]')?.textContent;
|
|
89
92
|
bookMetaJson.book.identifiers.crossref.doi = bookMetaNode.querySelector('book-id[assigning-authority="crossref"][book-id-type="doi"]')?.textContent;
|
|
93
|
+
bookMetaJson.book.identifiers.loc.lccn = bookMetaNode.querySelector('book-id[assigning-authority="Library of Congress"][book-id-type="lccn"]')?.textContent;
|
|
90
94
|
|
|
91
95
|
// Volume number
|
|
92
96
|
bookMetaJson.book.identifiers.AMS.volumeNr = bookMetaNode.querySelector('book-volume-number')?.textContent;
|
package/lib/elements/ext-link.js
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { unnestLinks } from '../helpers/unnest.js';
|
|
18
17
|
import { node2macro } from '../helpers/helpers-tex.js';
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -27,12 +26,16 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
27
26
|
node2macro.apply(this, [htmlParentNode, xmlnode, `href{${xmlnode.getAttribute('xlink:href')}}`, true]); // NOTE href works in both math and text mode; `\href`'s first argument does not need escaping
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const isNestedLink = htmlParentNode.closest('a');
|
|
30
|
+
if (isNestedLink) console.log('Warning: texml-to-html: Nested ext-link', xmlnode.outerHTML);
|
|
31
|
+
const anchor = isNestedLink ?
|
|
32
|
+
this.createNode('span', '', {
|
|
33
|
+
'data-ams-href': xmlnode.getAttribute('xlink:href')
|
|
34
|
+
})
|
|
35
|
+
: this.createNode('a', '', {
|
|
36
|
+
href: xmlnode.getAttribute('xlink:href')
|
|
37
|
+
});
|
|
33
38
|
htmlParentNode.appendChild(anchor);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (linkChild) unnestLinks(this.recurseTheDom, this.createNode, xmlnode, anchor, linkChild)
|
|
37
|
-
else this.passThrough(anchor, xmlnode);
|
|
39
|
+
|
|
40
|
+
this.passThrough(anchor, xmlnode);
|
|
38
41
|
};
|
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');
|
|
@@ -24,6 +24,7 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
24
24
|
htmlParentNode.appendChild(li);
|
|
25
25
|
const anchor = this.createNode('a', '', {
|
|
26
26
|
href: `#${xmlnode.querySelector('nav-pointer').getAttribute('rid')}`,
|
|
27
|
+
"data-ams-ref": xmlnode.getAttribute('specific-use') // NOTE: specific-use contains `ref@ref-type`-like information (e.g., 'chapter', 'section')
|
|
27
28
|
});
|
|
28
29
|
li.appendChild(anchor);
|
|
29
30
|
// NOTE unify label/title processing with label() - requires some form of new wrapper around content in lieu of heading (or have it add the anchor but then the nav-pointer will be odd to pull in). See #398
|
package/lib/elements/x.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export default function (htmlParentNode, xmlnode) {
|
|
23
23
|
// ignore if not xref/x or isBook
|
|
24
|
-
if ('xref'
|
|
24
|
+
if (!xmlnode.closest('xref') && xmlnode.closest('article'))
|
|
25
25
|
return;
|
|
26
26
|
this.passThrough(htmlParentNode, xmlnode);
|
|
27
27
|
};
|
package/lib/elements/xref.js
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { unnestLinks } from '../helpers/unnest.js';
|
|
18
17
|
import { replaceTeXCharactersInNodes } from '../helpers/helpers-tex.js';
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -23,10 +22,28 @@ import { replaceTeXCharactersInNodes } from '../helpers/helpers-tex.js';
|
|
|
23
22
|
* @param {Element} xmlnode
|
|
24
23
|
*/
|
|
25
24
|
export default function (htmlParentNode, xmlnode) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const rid = xmlnode.getAttribute('rid');
|
|
26
|
+
|
|
27
|
+
// case: no RID
|
|
28
|
+
if (!rid) {
|
|
29
|
+
const span = this.createNode('span', '', {
|
|
30
|
+
'data-ams-ref': 'notrid'
|
|
31
|
+
});
|
|
32
|
+
htmlParentNode.appendChild(span);
|
|
33
|
+
this.passThrough(span, xmlnode);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// case nested links
|
|
38
|
+
const isNestedLink = htmlParentNode.closest('a');
|
|
39
|
+
if (isNestedLink) {
|
|
40
|
+
const anchor =
|
|
41
|
+
this.createNode('span', '', {
|
|
42
|
+
'data-ams-href': rid,
|
|
43
|
+
})
|
|
44
|
+
htmlParentNode.appendChild(anchor);
|
|
45
|
+
this.passThrough(anchor, xmlnode);
|
|
46
|
+
if (!xmlnode.closest('toc-entry')) console.log('Warning: texml-to-html: Nested xref', xmlnode.outerHTML);
|
|
30
47
|
return;
|
|
31
48
|
}
|
|
32
49
|
const refType = xmlnode.getAttribute('ref-type');
|
|
@@ -41,7 +58,6 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
41
58
|
[...texmathAncestor.querySelectorAll('*')].includes(foonoteAncestor)
|
|
42
59
|
)
|
|
43
60
|
) {
|
|
44
|
-
const rid = xmlnode.getAttribute('rid');
|
|
45
61
|
htmlParentNode.insertAdjacentText(
|
|
46
62
|
'beforeend',
|
|
47
63
|
`\\xhref[${refType}]{#${rid}}{`
|
|
@@ -53,15 +69,7 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
53
69
|
htmlParentNode.insertAdjacentText('beforeend', `}`);
|
|
54
70
|
return;
|
|
55
71
|
}
|
|
56
|
-
|
|
57
|
-
if (!rid) {
|
|
58
|
-
const span = this.createNode('span', '', {
|
|
59
|
-
'data-ams-ref': 'notrid'
|
|
60
|
-
});
|
|
61
|
-
htmlParentNode.appendChild(span);
|
|
62
|
-
this.passThrough(span, xmlnode);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
72
|
+
// the "regular" case: a cross-reference
|
|
65
73
|
const anchor = this.createNode('a', '', {
|
|
66
74
|
href: `#${rid}`,
|
|
67
75
|
'data-ams-ref': refType
|
|
@@ -78,10 +86,8 @@ export default function (htmlParentNode, xmlnode) {
|
|
|
78
86
|
} else {
|
|
79
87
|
htmlParentNode.appendChild(anchor);
|
|
80
88
|
}
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
if (linkChild) unnestLinks(this.recurseTheDom, this.createNode, xmlnode, anchor, linkChild)
|
|
84
|
-
else this.passThrough(anchor, xmlnode);
|
|
89
|
+
// Recursion
|
|
90
|
+
this.passThrough(anchor, xmlnode);
|
|
85
91
|
// footonote ref gets wrapped in <sup>
|
|
86
92
|
if (isFootnoteRef) {
|
|
87
93
|
anchor.innerHTML = `<sup>${anchor.innerHTML}</sup>`;
|
package/lib/transformer.js
CHANGED
|
@@ -126,6 +126,8 @@ export class Transformer {
|
|
|
126
126
|
'td',
|
|
127
127
|
'pre',
|
|
128
128
|
'hr',
|
|
129
|
+
'cite-group',
|
|
130
|
+
'cite-detail',
|
|
129
131
|
].forEach(mapTag.bind(null, this.copyElement));
|
|
130
132
|
// passThrough elements
|
|
131
133
|
[
|
|
@@ -144,7 +146,6 @@ export class Transformer {
|
|
|
144
146
|
'back',
|
|
145
147
|
'alternatives',
|
|
146
148
|
'title-group',
|
|
147
|
-
'cite-group',
|
|
148
149
|
'app-group',
|
|
149
150
|
'book-title-group',
|
|
150
151
|
'private-char',
|
|
@@ -201,7 +202,7 @@ export class Transformer {
|
|
|
201
202
|
this.passThrough(span, xmlnode);
|
|
202
203
|
return span.innerHTML.trim();
|
|
203
204
|
}
|
|
204
|
-
|
|
205
|
+
|
|
205
206
|
// extract contrib-groups into json data
|
|
206
207
|
extractContribGroups = extractContribGroups.bind(this);
|
|
207
208
|
|
package/package.json
CHANGED
package/test/article.xml
CHANGED
|
@@ -420,9 +420,9 @@
|
|
|
420
420
|
</target>
|
|
421
421
|
</disp-formula>
|
|
422
422
|
</sec>
|
|
423
|
-
<!--
|
|
423
|
+
<!-- citegroup, cite-detail-->
|
|
424
424
|
<sec disp-level="1" id="citegroup" specific-use="section">
|
|
425
|
-
|
|
425
|
+
<cite-group><x>[</x><xref ref-type="bibr" rid="bibr-AEG0" specific-use="cite">AEG08<cite-detail><x>, </x>Section 5</cite-detail></xref><x>; </x><xref ref-type="bibr" rid="bibr-AEG0" specific-use="cite">AEG08</xref><x>]</x></cite-group>
|
|
426
426
|
</sec>
|
|
427
427
|
|
|
428
428
|
<!-- alt-title -->
|
package/test/book.xml
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<book-id assigning-authority="AMS" book-id-type="publisher">series</book-id>
|
|
25
25
|
<book-id assigning-authority="AMS" book-id-type="volume_id">volume</book-id>
|
|
26
26
|
<book-id assigning-authority="crossref" book-id-type="doi">doi</book-id>
|
|
27
|
+
<book-id assigning-authority="Library of Congress" book-id-type="lccn">0123456789</book-id>
|
|
27
28
|
<book-title-group>
|
|
28
29
|
<book-title>title</book-title>
|
|
29
30
|
<subtitle>subtitle</subtitle>
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
<title-group>
|
|
86
87
|
<title>Contents</title>
|
|
87
88
|
</title-group>
|
|
88
|
-
<toc-entry>
|
|
89
|
+
<toc-entry specific-use="chapter">
|
|
89
90
|
<title>Chunk</title>
|
|
90
91
|
<nav-pointer rid="tocid1"/>
|
|
91
92
|
</toc-entry>
|
|
@@ -266,6 +267,11 @@
|
|
|
266
267
|
<line indent="1">Indented line.</line>
|
|
267
268
|
</simpletabbing>
|
|
268
269
|
</sec>
|
|
270
|
+
<!-- citegroup, cite-detail-->
|
|
271
|
+
<sec disp-level="1" id="citegroup" specific-use="section">
|
|
272
|
+
<cite-group><x>[</x><xref ref-type="bibr" rid="bibr-AEG0" specific-use="cite">AEG08<cite-detail><x>, </x>Section 5</cite-detail></xref><x>; </x><xref ref-type="bibr" rid="bibr-AEG0" specific-use="cite">AEG08</xref><x>]</x></cite-group>
|
|
273
|
+
</sec>
|
|
274
|
+
|
|
269
275
|
</body>
|
|
270
276
|
</book-part>
|
|
271
277
|
</book-body>
|
|
@@ -18,8 +18,8 @@ import { article } from './helper.js';
|
|
|
18
18
|
import tape from 'tape';
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
tape('Template: cite-
|
|
21
|
+
tape('Template: cite-detail', async function(t) {
|
|
22
22
|
t.plan(1);
|
|
23
|
-
|
|
24
|
-
t.equal(
|
|
23
|
+
|
|
24
|
+
t.equal(article.querySelector('cite-detail').outerHTML, '<cite-detail>, Section 5</cite-detail>', 'cite-detail');
|
|
25
25
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
import { article, book } from './helper.js';
|
|
18
|
+
import tape from 'tape';
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
tape('Template: cite-group', async function (t) {
|
|
22
|
+
t.plan(2);
|
|
23
|
+
|
|
24
|
+
t.equal(article.querySelector('cite-group').outerHTML, '<cite-group><cite><a role="doc-biblioref" data-ams-ref="bibr" href="#bibr-AEG0">AEG08<cite-detail>, Section 5</cite-detail></a></cite><cite><a role="doc-biblioref" data-ams-ref="bibr" href="#bibr-AEG0">AEG08</a></cite></cite-group>', 'cite-group in article');
|
|
25
|
+
t.equal(book.querySelector('cite-group').outerHTML, '<cite-group>[<cite><a role="doc-biblioref" data-ams-ref="bibr" href="#bibr-AEG0">AEG08<cite-detail>, Section 5</cite-detail></a></cite>; <cite><a role="doc-biblioref" data-ams-ref="bibr" href="#bibr-AEG0">AEG08</a></cite>]</cite-group>', 'cite-group in book');
|
|
26
|
+
|
|
27
|
+
});
|
package/test/element-ext-link.js
CHANGED
|
@@ -20,11 +20,10 @@ import tape from 'tape';
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
tape('Template: ext-link', async function (t) {
|
|
23
|
-
t.plan(
|
|
23
|
+
t.plan(2);
|
|
24
24
|
const document = article;
|
|
25
25
|
const extlink = document.querySelector('a[href="https://"]');
|
|
26
26
|
t.ok(extlink, 'Element ext-link becomes a with href');
|
|
27
|
-
t.
|
|
28
|
-
t.ok(document.querySelector('a[href="https://nested2"]+span').querySelector('a[data-ams-ref="nested"]'), 'xref inside ext-link moved after ext-link');
|
|
27
|
+
t.equal(document.querySelector('a[href="https://nested2"]').outerHTML, '<a href="https://nested2"><span data-ams-href="rid6"></span></a>', 'xref inside ext-link flattened');
|
|
29
28
|
});
|
|
30
29
|
|
|
@@ -29,9 +29,9 @@ tape('Template: (book) toc, toc-entry', async function(t) {
|
|
|
29
29
|
t.ok(list, 'toc: ordered list');
|
|
30
30
|
t.equal(list.children.length, 6, 'Nested toc-entries remain nested')
|
|
31
31
|
t.equal(
|
|
32
|
-
list.querySelector('li a[href="#tocid1"]').innerHTML,
|
|
32
|
+
list.querySelector('li a[href="#tocid1"][data-ams-ref="chapter"]').innerHTML,
|
|
33
33
|
'Chunk',
|
|
34
|
-
'toc-entry and nav-pointer'
|
|
34
|
+
'toc-entry and nav-pointer with href and data-ams-ref'
|
|
35
35
|
);
|
|
36
36
|
t.equal(
|
|
37
37
|
list.querySelector('li a[href="#tocid2"]').innerHTML,
|
|
@@ -46,7 +46,7 @@ tape('Template: (book) toc, toc-entry', async function(t) {
|
|
|
46
46
|
);
|
|
47
47
|
t.equal(
|
|
48
48
|
list.querySelector('li a[href="#tocid4"]').innerHTML,
|
|
49
|
-
'1. SubSubChunk with Link',
|
|
49
|
+
'1. SubSubChunk with <span data-ams-href="chapter">Link</span>',
|
|
50
50
|
'toc-entry with xref in title'
|
|
51
51
|
);
|
|
52
52
|
t.equal(
|
package/test/element-xref.js
CHANGED
|
@@ -20,13 +20,12 @@ import tape from 'tape';
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
tape('Template: xref', async function(t) {
|
|
23
|
-
t.plan(
|
|
23
|
+
t.plan(6);
|
|
24
24
|
const document = article;
|
|
25
25
|
t.ok(document.querySelector('a[href="#rid1"][data-ams-ref="type"]'), 'xref as anchor with href, data-ams-ref');
|
|
26
26
|
t.ok(document.querySelector('a[href="#rid2"][data-ams-ref="fn"][role="doc-noteref"]'), 'xref with ref-type fn has role doc-noteref');
|
|
27
27
|
t.equal(document.querySelector('a[data-ams-ref="fn"]').firstElementChild.tagName, 'SUP', 'xref with ref-type fn has firstChild sup');
|
|
28
28
|
t.ok(document.querySelector('cite a[href="#rid3"][data-ams-ref="bibr"][role="doc-biblioref"]'), 'xref with ref-type bibr a cite with anchor with href, data-ams-ref, role doc-biblioref');
|
|
29
29
|
t.ok(document.querySelector('span[data-ams-ref="notrid"]'), 'xref without rid as span with data-ams-ref notrid');
|
|
30
|
-
t.
|
|
31
|
-
t.ok(document.querySelector('a[data-ams-ref="nested"]+span').querySelector('a[href="https://nested"]'), 'ext-link inside xref moved after xref');
|
|
30
|
+
t.equal(document.querySelector('a[data-ams-ref="nested"]').outerHTML, '<a data-ams-ref="nested" href="#rid6"><span data-ams-href="https://nested"></span></a>', 'xref with ext-link inside: nested link flattened');
|
|
32
31
|
});
|
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/lib/helpers/unnest.js
DELETED
|
@@ -1,34 +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
|
-
* moves links into subsequent span
|
|
19
|
-
* @param {Function} recurseTheDom
|
|
20
|
-
* @param {Function} createNode
|
|
21
|
-
* @param {Node} xmlnode XML DOM node
|
|
22
|
-
* @param {Node} htmlnode HTML Dom Node
|
|
23
|
-
* @param {Node} linkChild XML Dom Node, child of xmlnode
|
|
24
|
-
* @returns {Boolean}
|
|
25
|
-
*/
|
|
26
|
-
export const unnestLinks = (recurseTheDom, createNode, xmlnode, htmlnode, linkChild) => {
|
|
27
|
-
const siblings = [...xmlnode.childNodes];
|
|
28
|
-
const precedingSiblings = siblings.slice(0, siblings.indexOf(linkChild));
|
|
29
|
-
const followingSiblings = siblings.slice(siblings.indexOf(linkChild));
|
|
30
|
-
const span = createNode('span');
|
|
31
|
-
htmlnode.insertAdjacentElement('afterend', span);
|
|
32
|
-
precedingSiblings.forEach(recurseTheDom.bind(null, htmlnode));
|
|
33
|
-
followingSiblings.forEach(recurseTheDom.bind(null, span));
|
|
34
|
-
}
|
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
|
-
|