@manuscripts/transform 4.3.10 → 4.3.12
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/dist/cjs/jats/exporter/citeproc.js +7 -11
- package/dist/cjs/jats/exporter/jats-exporter.js +1 -2
- package/dist/cjs/jats/importer/jats-transformations.js +2 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/exporter/citeproc.js +7 -11
- package/dist/es/jats/exporter/jats-exporter.js +1 -2
- package/dist/es/jats/importer/jats-transformations.js +2 -1
- package/dist/es/version.js +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -135,18 +135,14 @@ const wrappers = {
|
|
|
135
135
|
issue: (str) => `<issue>${str}</issue>`,
|
|
136
136
|
supplement: (str) => `<supplement>${str}</supplement>`,
|
|
137
137
|
page: (str) => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
lpage
|
|
138
|
+
const parts = str.split(/([-–])/);
|
|
139
|
+
if (parts.length === 3) {
|
|
140
|
+
const fpage = parts[0].trim();
|
|
141
|
+
const separator = parts[1].trim();
|
|
142
|
+
const lpage = parts[2].trim();
|
|
143
|
+
return `<fpage>${fpage}</fpage>${separator}<lpage>${lpage}</lpage>`;
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
if (lpage) {
|
|
147
|
-
str = str.replace(lpage, `<lpage>${lpage}</lpage>`);
|
|
148
|
-
}
|
|
149
|
-
return str;
|
|
145
|
+
return `<fpage>${str.trim()}</fpage>`;
|
|
150
146
|
},
|
|
151
147
|
title: (str, item) => {
|
|
152
148
|
const type = item.type;
|
|
@@ -1413,8 +1413,7 @@ class JATSExporter {
|
|
|
1413
1413
|
footNote.setAttribute('fn-type', fnType);
|
|
1414
1414
|
const title = section.querySelector('title');
|
|
1415
1415
|
if (title) {
|
|
1416
|
-
const footNoteTitle = this.createElement('
|
|
1417
|
-
footNoteTitle.setAttribute('content-type', 'fn-title');
|
|
1416
|
+
const footNoteTitle = this.createElement('label');
|
|
1418
1417
|
footNoteTitle.textContent = title.textContent;
|
|
1419
1418
|
section.removeChild(title);
|
|
1420
1419
|
footNote.append(footNoteTitle);
|
|
@@ -187,7 +187,8 @@ const moveSpecialFootnotes = (doc, group, sectionCategories, createElement) => {
|
|
|
187
187
|
const category = sectionCategories.find((category) => category.synonyms.includes(type));
|
|
188
188
|
if (category) {
|
|
189
189
|
const section = createElement('sec');
|
|
190
|
-
const fnTitle = fn.querySelector('
|
|
190
|
+
const fnTitle = fn.querySelector('label') ||
|
|
191
|
+
fn.querySelector('p[content-type="fn-title"]');
|
|
191
192
|
if (fnTitle) {
|
|
192
193
|
const title = createElement('title');
|
|
193
194
|
const titleText = fnTitle.textContent?.trim();
|
package/dist/cjs/version.js
CHANGED
|
@@ -128,18 +128,14 @@ const wrappers = {
|
|
|
128
128
|
issue: (str) => `<issue>${str}</issue>`,
|
|
129
129
|
supplement: (str) => `<supplement>${str}</supplement>`,
|
|
130
130
|
page: (str) => {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
lpage
|
|
131
|
+
const parts = str.split(/([-–])/);
|
|
132
|
+
if (parts.length === 3) {
|
|
133
|
+
const fpage = parts[0].trim();
|
|
134
|
+
const separator = parts[1].trim();
|
|
135
|
+
const lpage = parts[2].trim();
|
|
136
|
+
return `<fpage>${fpage}</fpage>${separator}<lpage>${lpage}</lpage>`;
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
if (lpage) {
|
|
140
|
-
str = str.replace(lpage, `<lpage>${lpage}</lpage>`);
|
|
141
|
-
}
|
|
142
|
-
return str;
|
|
138
|
+
return `<fpage>${str.trim()}</fpage>`;
|
|
143
139
|
},
|
|
144
140
|
title: (str, item) => {
|
|
145
141
|
const type = item.type;
|
|
@@ -1373,8 +1373,7 @@ export class JATSExporter {
|
|
|
1373
1373
|
footNote.setAttribute('fn-type', fnType);
|
|
1374
1374
|
const title = section.querySelector('title');
|
|
1375
1375
|
if (title) {
|
|
1376
|
-
const footNoteTitle = this.createElement('
|
|
1377
|
-
footNoteTitle.setAttribute('content-type', 'fn-title');
|
|
1376
|
+
const footNoteTitle = this.createElement('label');
|
|
1378
1377
|
footNoteTitle.textContent = title.textContent;
|
|
1379
1378
|
section.removeChild(title);
|
|
1380
1379
|
footNote.append(footNoteTitle);
|
|
@@ -172,7 +172,8 @@ const moveSpecialFootnotes = (doc, group, sectionCategories, createElement) => {
|
|
|
172
172
|
const category = sectionCategories.find((category) => category.synonyms.includes(type));
|
|
173
173
|
if (category) {
|
|
174
174
|
const section = createElement('sec');
|
|
175
|
-
const fnTitle = fn.querySelector('
|
|
175
|
+
const fnTitle = fn.querySelector('label') ||
|
|
176
|
+
fn.querySelector('p[content-type="fn-title"]');
|
|
176
177
|
if (fnTitle) {
|
|
177
178
|
const title = createElement('title');
|
|
178
179
|
const titleText = fnTitle.textContent?.trim();
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "4.3.
|
|
1
|
+
export const VERSION = "4.3.12";
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.3.
|
|
1
|
+
export declare const VERSION = "4.3.12";
|
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": "4.3.
|
|
4
|
+
"version": "4.3.12",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|