@manuscripts/transform 2.3.4-LEAN-3579.4 → 2.3.4
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.
|
@@ -1702,13 +1702,15 @@ class JATSExporter {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
});
|
|
1704
1704
|
}
|
|
1705
|
+
fillEmptyElements(articleElement, selector, tagName = 'p') {
|
|
1706
|
+
const emptyElements = Array.from(articleElement.querySelectorAll(selector)).filter((element) => !element.innerHTML);
|
|
1707
|
+
emptyElements.forEach((element) => element.appendChild(this.document.createElement(tagName)));
|
|
1708
|
+
}
|
|
1705
1709
|
fillEmptyFootnotes(articleElement) {
|
|
1706
|
-
|
|
1707
|
-
emptyFootnotes.forEach((fn) => fn.appendChild(this.document.createElement('p')));
|
|
1710
|
+
this.fillEmptyElements(articleElement, 'fn');
|
|
1708
1711
|
}
|
|
1709
1712
|
fillEmptyTableFooters(articleElement) {
|
|
1710
|
-
|
|
1711
|
-
emptyElements.forEach((element) => element.appendChild(this.document.createElement('p')));
|
|
1713
|
+
this.fillEmptyElements(articleElement, 'table-wrap-foot');
|
|
1712
1714
|
}
|
|
1713
1715
|
}
|
|
1714
1716
|
exports.JATSExporter = JATSExporter;
|
|
@@ -1694,12 +1694,14 @@ export class JATSExporter {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
});
|
|
1696
1696
|
}
|
|
1697
|
+
fillEmptyElements(articleElement, selector, tagName = 'p') {
|
|
1698
|
+
const emptyElements = Array.from(articleElement.querySelectorAll(selector)).filter((element) => !element.innerHTML);
|
|
1699
|
+
emptyElements.forEach((element) => element.appendChild(this.document.createElement(tagName)));
|
|
1700
|
+
}
|
|
1697
1701
|
fillEmptyFootnotes(articleElement) {
|
|
1698
|
-
|
|
1699
|
-
emptyFootnotes.forEach((fn) => fn.appendChild(this.document.createElement('p')));
|
|
1702
|
+
this.fillEmptyElements(articleElement, 'fn');
|
|
1700
1703
|
}
|
|
1701
1704
|
fillEmptyTableFooters(articleElement) {
|
|
1702
|
-
|
|
1703
|
-
emptyElements.forEach((element) => element.appendChild(this.document.createElement('p')));
|
|
1705
|
+
this.fillEmptyElements(articleElement, 'table-wrap-foot');
|
|
1704
1706
|
}
|
|
1705
1707
|
}
|
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
|
|
4
|
+
"version": "2.3.4",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|