@manuscripts/transform 2.3.3 → 2.3.4-LEAN-3579.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.
|
@@ -154,6 +154,7 @@ class JATSExporter {
|
|
|
154
154
|
this.moveFloatsGroup(body, article);
|
|
155
155
|
this.removeBackContainer(body);
|
|
156
156
|
this.updateFootnoteTypes(front, back);
|
|
157
|
+
this.fillEmptyFootnotesElements(article);
|
|
157
158
|
this.fillEmptyFootnotes(article);
|
|
158
159
|
}
|
|
159
160
|
await this.rewriteIDs(idGenerator);
|
|
@@ -598,7 +599,7 @@ class JATSExporter {
|
|
|
598
599
|
title: () => '',
|
|
599
600
|
affiliations: () => '',
|
|
600
601
|
contributors: () => '',
|
|
601
|
-
table_element_footer: (
|
|
602
|
+
table_element_footer: () => ['table-wrap-foot', 0],
|
|
602
603
|
contributor: () => '',
|
|
603
604
|
affiliation: () => '',
|
|
604
605
|
attribution: () => ['attrib', 0],
|
|
@@ -720,9 +721,6 @@ class JATSExporter {
|
|
|
720
721
|
return ['fn', attrs, 0];
|
|
721
722
|
},
|
|
722
723
|
footnotes_element: (node) => {
|
|
723
|
-
if (!node.textContent) {
|
|
724
|
-
return '';
|
|
725
|
-
}
|
|
726
724
|
const kind = node.attrs.kind;
|
|
727
725
|
let tag = 'fn-group';
|
|
728
726
|
if (kind && kind.includes('table')) {
|
|
@@ -1707,5 +1705,9 @@ class JATSExporter {
|
|
|
1707
1705
|
const emptyFootnotes = Array.from(articleElement.querySelectorAll('fn')).filter((fn) => { var _a; return !((_a = fn.textContent) === null || _a === void 0 ? void 0 : _a.trim()); });
|
|
1708
1706
|
emptyFootnotes.forEach((fn) => fn.appendChild(this.document.createElement('p')));
|
|
1709
1707
|
}
|
|
1708
|
+
fillEmptyFootnotesElements(articleElement) {
|
|
1709
|
+
const emptyElements = Array.from(articleElement.querySelectorAll('fn-group')).filter((element) => !element.querySelector('fn') && !element.querySelector('p'));
|
|
1710
|
+
emptyElements.forEach((element) => element.appendChild(this.document.createElement('fn')));
|
|
1711
|
+
}
|
|
1710
1712
|
}
|
|
1711
1713
|
exports.JATSExporter = JATSExporter;
|
|
@@ -146,6 +146,7 @@ export class JATSExporter {
|
|
|
146
146
|
this.moveFloatsGroup(body, article);
|
|
147
147
|
this.removeBackContainer(body);
|
|
148
148
|
this.updateFootnoteTypes(front, back);
|
|
149
|
+
this.fillEmptyFootnotesElements(article);
|
|
149
150
|
this.fillEmptyFootnotes(article);
|
|
150
151
|
}
|
|
151
152
|
await this.rewriteIDs(idGenerator);
|
|
@@ -590,7 +591,7 @@ export class JATSExporter {
|
|
|
590
591
|
title: () => '',
|
|
591
592
|
affiliations: () => '',
|
|
592
593
|
contributors: () => '',
|
|
593
|
-
table_element_footer: (
|
|
594
|
+
table_element_footer: () => ['table-wrap-foot', 0],
|
|
594
595
|
contributor: () => '',
|
|
595
596
|
affiliation: () => '',
|
|
596
597
|
attribution: () => ['attrib', 0],
|
|
@@ -712,9 +713,6 @@ export class JATSExporter {
|
|
|
712
713
|
return ['fn', attrs, 0];
|
|
713
714
|
},
|
|
714
715
|
footnotes_element: (node) => {
|
|
715
|
-
if (!node.textContent) {
|
|
716
|
-
return '';
|
|
717
|
-
}
|
|
718
716
|
const kind = node.attrs.kind;
|
|
719
717
|
let tag = 'fn-group';
|
|
720
718
|
if (kind && kind.includes('table')) {
|
|
@@ -1699,4 +1697,8 @@ export class JATSExporter {
|
|
|
1699
1697
|
const emptyFootnotes = Array.from(articleElement.querySelectorAll('fn')).filter((fn) => { var _a; return !((_a = fn.textContent) === null || _a === void 0 ? void 0 : _a.trim()); });
|
|
1700
1698
|
emptyFootnotes.forEach((fn) => fn.appendChild(this.document.createElement('p')));
|
|
1701
1699
|
}
|
|
1700
|
+
fillEmptyFootnotesElements(articleElement) {
|
|
1701
|
+
const emptyElements = Array.from(articleElement.querySelectorAll('fn-group')).filter((element) => !element.querySelector('fn') && !element.querySelector('p'));
|
|
1702
|
+
emptyElements.forEach((element) => element.appendChild(this.document.createElement('fn')));
|
|
1703
|
+
}
|
|
1702
1704
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/transform",
|
|
3
3
|
"description": "ProseMirror transformer for Manuscripts applications",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.4-LEAN-3579.1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -78,4 +78,4 @@
|
|
|
78
78
|
"rimraf": "^3.0.2",
|
|
79
79
|
"typescript": "^4.0.5"
|
|
80
80
|
}
|
|
81
|
-
}
|
|
81
|
+
}
|