@manuscripts/transform 2.1.5-LEAN-3376-0 → 2.1.5-LEAN-3376-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.
|
@@ -1295,10 +1295,15 @@ class JATSExporter {
|
|
|
1295
1295
|
element.appendChild(correspondingEl);
|
|
1296
1296
|
};
|
|
1297
1297
|
this.appendParagraphToElement = (paragraph, element) => {
|
|
1298
|
-
const
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1301
|
-
|
|
1298
|
+
const parsedDoc = new DOMParser().parseFromString(paragraph.contents, 'text/html');
|
|
1299
|
+
const parsedParagraph = parsedDoc.body.querySelector('p');
|
|
1300
|
+
if (parsedParagraph) {
|
|
1301
|
+
const paragraphEl = this.document.createElement('p');
|
|
1302
|
+
paragraphEl.innerHTML = parsedParagraph.innerHTML;
|
|
1303
|
+
const value = parsedParagraph.getAttribute('id');
|
|
1304
|
+
if (value) {
|
|
1305
|
+
paragraphEl.setAttribute('id', value);
|
|
1306
|
+
}
|
|
1302
1307
|
element.appendChild(paragraphEl);
|
|
1303
1308
|
}
|
|
1304
1309
|
};
|
|
@@ -1287,10 +1287,15 @@ export class JATSExporter {
|
|
|
1287
1287
|
element.appendChild(correspondingEl);
|
|
1288
1288
|
};
|
|
1289
1289
|
this.appendParagraphToElement = (paragraph, element) => {
|
|
1290
|
-
const
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1293
|
-
|
|
1290
|
+
const parsedDoc = new DOMParser().parseFromString(paragraph.contents, 'text/html');
|
|
1291
|
+
const parsedParagraph = parsedDoc.body.querySelector('p');
|
|
1292
|
+
if (parsedParagraph) {
|
|
1293
|
+
const paragraphEl = this.document.createElement('p');
|
|
1294
|
+
paragraphEl.innerHTML = parsedParagraph.innerHTML;
|
|
1295
|
+
const value = parsedParagraph.getAttribute('id');
|
|
1296
|
+
if (value) {
|
|
1297
|
+
paragraphEl.setAttribute('id', value);
|
|
1298
|
+
}
|
|
1294
1299
|
element.appendChild(paragraphEl);
|
|
1295
1300
|
}
|
|
1296
1301
|
};
|
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.1.5-LEAN-3376-
|
|
4
|
+
"version": "2.1.5-LEAN-3376-1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|