@manuscripts/transform 3.0.4-LEAN-4011.0 → 3.0.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.
Files changed (78) hide show
  1. package/dist/cjs/jats/exporter/jats-exporter.js +14 -67
  2. package/dist/cjs/jats/importer/jats-body-transformations.js +326 -0
  3. package/dist/cjs/jats/importer/jats-dom-parser.js +5 -43
  4. package/dist/cjs/lib/utils.js +1 -14
  5. package/dist/cjs/schema/nodes/bibliography_element.js +0 -1
  6. package/dist/cjs/schema/nodes/bibliography_item.js +0 -1
  7. package/dist/cjs/schema/nodes/blockquote_element.js +0 -3
  8. package/dist/cjs/schema/nodes/citation.js +0 -2
  9. package/dist/cjs/schema/nodes/cross_reference.js +1 -13
  10. package/dist/cjs/schema/nodes/equation_element.js +0 -1
  11. package/dist/cjs/schema/nodes/figure.js +0 -1
  12. package/dist/cjs/schema/nodes/figure_element.js +1 -28
  13. package/dist/cjs/schema/nodes/footnote.js +1 -5
  14. package/dist/cjs/schema/nodes/footnotes_element.js +1 -5
  15. package/dist/cjs/schema/nodes/graphical_abstract_section.js +0 -1
  16. package/dist/cjs/schema/nodes/keywords_element.js +0 -2
  17. package/dist/cjs/schema/nodes/list.js +0 -3
  18. package/dist/cjs/schema/nodes/listing_element.js +0 -2
  19. package/dist/cjs/schema/nodes/manuscript.js +0 -6
  20. package/dist/cjs/schema/nodes/missing_figure.js +0 -1
  21. package/dist/cjs/schema/nodes/paragraph.js +0 -3
  22. package/dist/cjs/schema/nodes/pullquote_element.js +1 -6
  23. package/dist/cjs/schema/nodes/section.js +2 -44
  24. package/dist/cjs/schema/nodes/table_element.js +0 -11
  25. package/dist/cjs/schema/nodes/toc_element.js +0 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/es/jats/exporter/jats-exporter.js +14 -67
  28. package/dist/es/jats/importer/jats-body-transformations.js +323 -0
  29. package/dist/es/jats/importer/jats-dom-parser.js +6 -44
  30. package/dist/es/lib/utils.js +0 -12
  31. package/dist/es/schema/nodes/bibliography_element.js +0 -1
  32. package/dist/es/schema/nodes/bibliography_item.js +0 -1
  33. package/dist/es/schema/nodes/blockquote_element.js +0 -3
  34. package/dist/es/schema/nodes/citation.js +0 -2
  35. package/dist/es/schema/nodes/cross_reference.js +1 -13
  36. package/dist/es/schema/nodes/equation_element.js +0 -1
  37. package/dist/es/schema/nodes/figure.js +0 -1
  38. package/dist/es/schema/nodes/figure_element.js +1 -28
  39. package/dist/es/schema/nodes/footnote.js +1 -5
  40. package/dist/es/schema/nodes/footnotes_element.js +1 -5
  41. package/dist/es/schema/nodes/graphical_abstract_section.js +0 -1
  42. package/dist/es/schema/nodes/keywords_element.js +0 -2
  43. package/dist/es/schema/nodes/list.js +0 -3
  44. package/dist/es/schema/nodes/listing_element.js +0 -2
  45. package/dist/es/schema/nodes/manuscript.js +0 -6
  46. package/dist/es/schema/nodes/missing_figure.js +0 -1
  47. package/dist/es/schema/nodes/paragraph.js +0 -3
  48. package/dist/es/schema/nodes/pullquote_element.js +1 -6
  49. package/dist/es/schema/nodes/section.js +1 -43
  50. package/dist/es/schema/nodes/table_element.js +0 -11
  51. package/dist/es/schema/nodes/toc_element.js +0 -1
  52. package/dist/es/version.js +1 -1
  53. package/dist/types/jats/exporter/jats-exporter.d.ts +1 -1
  54. package/dist/types/jats/importer/jats-body-transformations.d.ts +40 -0
  55. package/dist/types/lib/utils.d.ts +0 -1
  56. package/dist/types/schema/nodes/bibliography_element.d.ts +0 -1
  57. package/dist/types/schema/nodes/bibliography_item.d.ts +0 -1
  58. package/dist/types/schema/nodes/blockquote_element.d.ts +0 -1
  59. package/dist/types/schema/nodes/citation.d.ts +0 -1
  60. package/dist/types/schema/nodes/cross_reference.d.ts +0 -1
  61. package/dist/types/schema/nodes/equation_element.d.ts +0 -1
  62. package/dist/types/schema/nodes/figure_element.d.ts +0 -14
  63. package/dist/types/schema/nodes/footnote.d.ts +0 -1
  64. package/dist/types/schema/nodes/footnotes_element.d.ts +0 -1
  65. package/dist/types/schema/nodes/keywords_element.d.ts +1 -2
  66. package/dist/types/schema/nodes/list.d.ts +0 -1
  67. package/dist/types/schema/nodes/listing_element.d.ts +0 -2
  68. package/dist/types/schema/nodes/manuscript.d.ts +0 -6
  69. package/dist/types/schema/nodes/paragraph.d.ts +0 -1
  70. package/dist/types/schema/nodes/pullquote_element.d.ts +0 -1
  71. package/dist/types/schema/nodes/section.d.ts +1 -8
  72. package/dist/types/schema/nodes/table_element.d.ts +0 -8
  73. package/dist/types/schema/nodes/toc_element.d.ts +0 -1
  74. package/dist/types/version.d.ts +1 -1
  75. package/package.json +1 -1
  76. package/dist/cjs/lib/attributes.js +0 -26
  77. package/dist/es/lib/attributes.js +0 -22
  78. package/dist/types/lib/attributes.d.ts +0 -20
@@ -19,16 +19,8 @@ exports.isFigureElementNode = exports.figureElement = void 0;
19
19
  exports.figureElement = {
20
20
  content: '(paragraph | figure | missing_figure | placeholder)+ attribution* figcaption (listing | placeholder)',
21
21
  attrs: {
22
- figureLayout: { default: '' },
23
- figureStyle: { default: '' },
24
22
  id: { default: '' },
25
- label: { default: '' },
26
- sizeFraction: { default: 0 },
27
- alignment: { default: undefined },
28
- suppressCaption: { default: false },
29
- suppressTitle: { default: undefined },
30
23
  attribution: { default: undefined },
31
- alternatives: { default: undefined },
32
24
  dataTracked: { default: null },
33
25
  },
34
26
  selectable: false,
@@ -40,36 +32,17 @@ exports.figureElement = {
40
32
  const dom = p;
41
33
  return {
42
34
  id: dom.getAttribute('id'),
43
- figureStyle: dom.getAttribute('data-figure-style'),
44
- figureLayout: dom.getAttribute('data-figure-layout'),
45
- sizeFraction: Number(dom.getAttribute('data-size-fraction')) || 0,
46
- alignment: dom.getAttribute('data-alignment') || undefined,
47
35
  };
48
36
  },
49
37
  },
50
38
  ],
51
39
  toDOM: (node) => {
52
40
  const figureElementNode = node;
53
- const { id, figureStyle, figureLayout, alignment, sizeFraction } = figureElementNode.attrs;
41
+ const { id } = figureElementNode.attrs;
54
42
  const attrs = {};
55
43
  const classes = ['figure-group'];
56
- if (sizeFraction === 2) {
57
- classes.push('figure-group--static');
58
- }
59
44
  attrs.class = classes.join(' ');
60
45
  attrs.id = id;
61
- if (figureStyle) {
62
- attrs['data-figure-style'] = figureStyle;
63
- }
64
- if (figureLayout) {
65
- attrs['data-figure-layout'] = figureLayout;
66
- }
67
- if (sizeFraction) {
68
- attrs['data-size-fraction'] = String(sizeFraction);
69
- }
70
- if (alignment) {
71
- attrs['data-alignment'] = alignment;
72
- }
73
46
  return ['figure', attrs, 0];
74
47
  },
75
48
  };
@@ -22,7 +22,6 @@ exports.footnote = {
22
22
  attrs: {
23
23
  id: { default: '' },
24
24
  kind: { default: 'footnote' },
25
- paragraphStyle: { default: '' },
26
25
  placeholder: { default: '' },
27
26
  dataTracked: { default: null },
28
27
  },
@@ -45,7 +44,7 @@ exports.footnote = {
45
44
  ],
46
45
  toDOM: (node) => {
47
46
  const footnoteNode = node;
48
- const { kind, paragraphStyle, placeholder, id } = footnoteNode.attrs;
47
+ const { kind, placeholder, id } = footnoteNode.attrs;
49
48
  const attrs = { class: 'footnote-text', id: '' };
50
49
  if (kind) {
51
50
  attrs['data-kind'] = kind;
@@ -53,9 +52,6 @@ exports.footnote = {
53
52
  if (id) {
54
53
  attrs.id = id;
55
54
  }
56
- if (paragraphStyle) {
57
- attrs.paragraphStyle = paragraphStyle;
58
- }
59
55
  if (placeholder) {
60
56
  attrs['data-placeholder-text'] = placeholder;
61
57
  }
@@ -20,7 +20,6 @@ exports.footnotesElement = {
20
20
  attrs: {
21
21
  id: { default: '' },
22
22
  kind: { default: 'footnote' },
23
- paragraphStyle: { default: '' },
24
23
  dataTracked: { default: null },
25
24
  },
26
25
  content: 'footnote*',
@@ -39,14 +38,11 @@ exports.footnotesElement = {
39
38
  ],
40
39
  toDOM: (node) => {
41
40
  const footnotesElementNode = node;
42
- const { id, kind, paragraphStyle } = footnotesElementNode.attrs;
41
+ const { id, kind } = footnotesElementNode.attrs;
43
42
  const attrs = { class: 'footnotes', id };
44
43
  if (kind) {
45
44
  attrs['data-kind'] = kind;
46
45
  }
47
- if (paragraphStyle) {
48
- attrs['paragraphStyle'] = paragraphStyle;
49
- }
50
46
  return ['div', attrs, 0];
51
47
  },
52
48
  };
@@ -20,7 +20,6 @@ exports.graphicalAbstractSection = {
20
20
  content: 'section_title (figure_element | placeholder)',
21
21
  attrs: {
22
22
  id: { default: '' },
23
- category: { default: '' },
24
23
  dataTracked: { default: null },
25
24
  },
26
25
  group: 'block sections',
@@ -22,8 +22,6 @@ exports.keywordsElement = {
22
22
  attrs: {
23
23
  id: { default: '' },
24
24
  contents: { default: '' },
25
- paragraphStyle: { default: '' },
26
- type: { default: '' },
27
25
  dataTracked: { default: null },
28
26
  },
29
27
  group: 'block element',
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isListNode = exports.listItem = exports.list = exports.getListType = void 0;
4
4
  const json_schema_1 = require("@manuscripts/json-schema");
5
- const attributes_1 = require("../../lib/attributes");
6
5
  const getListType = (style) => {
7
6
  switch (style) {
8
7
  case 'simple':
@@ -29,7 +28,6 @@ exports.list = {
29
28
  group: 'block list element',
30
29
  attrs: {
31
30
  id: { default: '' },
32
- paragraphStyle: { default: '' },
33
31
  dataTracked: { default: null },
34
32
  listStyleType: { default: null },
35
33
  },
@@ -63,7 +61,6 @@ exports.list = {
63
61
  {
64
62
  id: list.attrs.id,
65
63
  'list-type': list.attrs.listStyleType,
66
- class: (0, attributes_1.buildElementClass)(list.attrs),
67
64
  'data-object-type': json_schema_1.ObjectTypes.ListElement,
68
65
  },
69
66
  0,
@@ -20,8 +20,6 @@ exports.listingElement = {
20
20
  content: '(listing | placeholder) figcaption',
21
21
  attrs: {
22
22
  id: { default: '' },
23
- suppressCaption: { default: true },
24
- suppressTitle: { default: undefined },
25
23
  dataTracked: { default: null },
26
24
  },
27
25
  group: 'block element',
@@ -24,12 +24,6 @@ exports.manuscript = {
24
24
  prototype: { default: '' },
25
25
  primaryLanguageCode: { default: '' },
26
26
  articleType: { default: '' },
27
- acceptanceDate: { default: undefined },
28
- correctionDate: { default: undefined },
29
- retractionDate: { default: undefined },
30
- revisionRequestDate: { default: undefined },
31
- revisionReceiveDate: { default: undefined },
32
- receiveDate: { default: undefined },
33
27
  },
34
28
  group: 'block',
35
29
  parseDOM: [
@@ -19,7 +19,6 @@ exports.missingFigure = void 0;
19
19
  exports.missingFigure = {
20
20
  attrs: {
21
21
  id: { default: '' },
22
- position: { default: undefined },
23
22
  dataTracked: { default: null },
24
23
  },
25
24
  selectable: false,
@@ -17,12 +17,10 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.isParagraphNode = exports.paragraph = void 0;
19
19
  const json_schema_1 = require("@manuscripts/json-schema");
20
- const attributes_1 = require("../../lib/attributes");
21
20
  exports.paragraph = {
22
21
  content: 'inline*',
23
22
  attrs: {
24
23
  id: { default: '' },
25
- paragraphStyle: { default: '' },
26
24
  placeholder: { default: '' },
27
25
  dataTracked: { default: null },
28
26
  },
@@ -50,7 +48,6 @@ exports.paragraph = {
50
48
  if (paragraphNode.attrs.id) {
51
49
  attrs.id = paragraphNode.attrs.id;
52
50
  }
53
- attrs.class = (0, attributes_1.buildElementClass)(paragraphNode.attrs);
54
51
  attrs['data-object-type'] = json_schema_1.ObjectTypes.ParagraphElement;
55
52
  if (paragraphNode.attrs.placeholder) {
56
53
  attrs['data-placeholder-text'] = paragraphNode.attrs.placeholder;
@@ -17,12 +17,10 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.isPullquoteElement = exports.pullquoteElement = void 0;
19
19
  const json_schema_1 = require("@manuscripts/json-schema");
20
- const attributes_1 = require("../../lib/attributes");
21
20
  exports.pullquoteElement = {
22
21
  content: 'paragraph+ attribution',
23
22
  attrs: {
24
23
  id: { default: '' },
25
- paragraphStyle: { default: '' },
26
24
  placeholder: { default: '' },
27
25
  dataTracked: { default: null },
28
26
  },
@@ -50,10 +48,7 @@ exports.pullquoteElement = {
50
48
  if (pullquoteElementNode.attrs.id) {
51
49
  attrs.id = pullquoteElementNode.attrs.id;
52
50
  }
53
- attrs.class = [
54
- 'pullquote',
55
- (0, attributes_1.buildElementClass)(pullquoteElementNode.attrs),
56
- ].join(' ');
51
+ attrs.class = 'pullquote';
57
52
  attrs['data-object-type'] = json_schema_1.ObjectTypes.QuoteElement;
58
53
  if (pullquoteElementNode.attrs.placeholder) {
59
54
  attrs['data-placeholder-text'] = pullquoteElementNode.attrs.placeholder;
@@ -15,33 +15,12 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.isSectionNode = exports.section = exports.PAGE_BREAK_BEFORE_AND_AFTER = exports.PAGE_BREAK_AFTER = exports.PAGE_BREAK_BEFORE = exports.PAGE_BREAK_NONE = void 0;
19
- exports.PAGE_BREAK_NONE = 0;
20
- exports.PAGE_BREAK_BEFORE = 1;
21
- exports.PAGE_BREAK_AFTER = 2;
22
- exports.PAGE_BREAK_BEFORE_AND_AFTER = 4;
23
- const choosePageBreakStyle = (element) => {
24
- const pageBreakAfter = element.classList.contains('page-break-after');
25
- const pageBreakBefore = element.classList.contains('page-break-before');
26
- if (pageBreakBefore && pageBreakAfter) {
27
- return exports.PAGE_BREAK_BEFORE_AND_AFTER;
28
- }
29
- if (pageBreakBefore) {
30
- return exports.PAGE_BREAK_BEFORE;
31
- }
32
- if (pageBreakAfter) {
33
- return exports.PAGE_BREAK_AFTER;
34
- }
35
- return exports.PAGE_BREAK_NONE;
36
- };
18
+ exports.isSectionNode = exports.section = void 0;
37
19
  exports.section = {
38
20
  content: 'section_label? section_title (paragraph | element)* sections*',
39
21
  attrs: {
40
22
  id: { default: '' },
41
23
  category: { default: '' },
42
- titleSuppressed: { default: false },
43
- generatedLabel: { default: undefined },
44
- pageBreakStyle: { default: undefined },
45
24
  dataTracked: { default: null },
46
25
  },
47
26
  group: 'block sections',
@@ -54,35 +33,14 @@ exports.section = {
54
33
  return {
55
34
  id: element.getAttribute('id') || '',
56
35
  category: element.getAttribute('data-category') || '',
57
- titleSuppressed: element.classList.contains('title-suppressed'),
58
- generatedLabel: element.classList.contains('generated-label'),
59
- pageBreakStyle: choosePageBreakStyle(element) || undefined,
60
36
  };
61
37
  },
62
38
  },
63
39
  ],
64
40
  toDOM: (node) => {
65
41
  const sectionNode = node;
66
- const { id, category, titleSuppressed, generatedLabel, pageBreakStyle } = sectionNode.attrs;
67
- const classnames = [];
68
- if (titleSuppressed) {
69
- classnames.push('title-suppressed');
70
- }
71
- if (typeof generatedLabel === 'undefined' || generatedLabel) {
72
- classnames.push('generated-label');
73
- }
74
- if (pageBreakStyle === exports.PAGE_BREAK_BEFORE ||
75
- pageBreakStyle === exports.PAGE_BREAK_BEFORE_AND_AFTER) {
76
- classnames.push('page-break-before');
77
- }
78
- if (pageBreakStyle === exports.PAGE_BREAK_AFTER ||
79
- pageBreakStyle === exports.PAGE_BREAK_BEFORE_AND_AFTER) {
80
- classnames.push('page-break-after');
81
- }
42
+ const { id, category } = sectionNode.attrs;
82
43
  const attrs = { id };
83
- if (classnames.length) {
84
- attrs['class'] = classnames.join(' ');
85
- }
86
44
  if (category) {
87
45
  attrs['data-category'] = node.attrs.category;
88
46
  }
@@ -20,14 +20,7 @@ exports.tableElement = {
20
20
  content: ' figcaption? (table | placeholder) table_colgroup? table_element_footer? (listing | placeholder)',
21
21
  attrs: {
22
22
  id: { default: '' },
23
- paragraphStyle: { default: '' },
24
- tableStyle: { default: '' },
25
23
  label: { default: '' },
26
- suppressCaption: { default: false },
27
- suppressTitle: { default: undefined },
28
- suppressFooter: { default: false },
29
- suppressHeader: { default: false },
30
- expandListing: { default: false },
31
24
  dataTracked: { default: null },
32
25
  },
33
26
  selectable: false,
@@ -39,8 +32,6 @@ exports.tableElement = {
39
32
  const element = dom;
40
33
  return {
41
34
  id: element.getAttribute('id'),
42
- paragraphStyle: element.getAttribute('data-paragraph-style') || '',
43
- tableStyle: element.getAttribute('data-table-style') || '',
44
35
  };
45
36
  },
46
37
  },
@@ -52,8 +43,6 @@ exports.tableElement = {
52
43
  {
53
44
  class: 'table',
54
45
  id: tableElementNode.attrs.id,
55
- 'data-paragraph-style': tableElementNode.attrs.paragraphStyle,
56
- 'data-table-style': tableElementNode.attrs.tableStyle,
57
46
  },
58
47
  0,
59
48
  ];
@@ -28,7 +28,6 @@ exports.tocElement = {
28
28
  attrs: {
29
29
  id: { default: '' },
30
30
  contents: { default: '' },
31
- paragraphStyle: { default: '' },
32
31
  dataTracked: { default: null },
33
32
  },
34
33
  group: 'block element',
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "3.0.4-LEAN-4011.0";
4
+ exports.VERSION = "3.0.4";
@@ -283,35 +283,6 @@ export class JATSExporter {
283
283
  supplementaryMaterial.append(caption);
284
284
  articleMeta.append(supplementaryMaterial);
285
285
  });
286
- const history = articleMeta.querySelector('history') ||
287
- this.document.createElement('history');
288
- if (this.manuscriptNode.attrs.acceptanceDate) {
289
- const date = this.buildDateElement(this.manuscriptNode.attrs.acceptanceDate, 'accepted');
290
- history.appendChild(date);
291
- }
292
- if (this.manuscriptNode.attrs.correctionDate) {
293
- const date = this.buildDateElement(this.manuscriptNode.attrs.correctionDate, 'corrected');
294
- history.appendChild(date);
295
- }
296
- if (this.manuscriptNode.attrs.retractionDate) {
297
- const date = this.buildDateElement(this.manuscriptNode.attrs.retractionDate, 'retracted');
298
- history.appendChild(date);
299
- }
300
- if (this.manuscriptNode.attrs.receiveDate) {
301
- const date = this.buildDateElement(this.manuscriptNode.attrs.receiveDate, 'received');
302
- history.appendChild(date);
303
- }
304
- if (this.manuscriptNode.attrs.revisionReceiveDate) {
305
- const date = this.buildDateElement(this.manuscriptNode.attrs.revisionReceiveDate, 'rev-recd');
306
- history.appendChild(date);
307
- }
308
- if (this.manuscriptNode.attrs.revisionRequestDate) {
309
- const date = this.buildDateElement(this.manuscriptNode.attrs.revisionRequestDate, 'rev-request');
310
- history.appendChild(date);
311
- }
312
- if (history.childElementCount) {
313
- articleMeta.appendChild(history);
314
- }
315
286
  this.buildKeywords(articleMeta);
316
287
  let countingElements = [];
317
288
  const figureCount = findChildrenByType(this.manuscriptNode, schema.nodes.figure).length;
@@ -602,17 +573,18 @@ export class JATSExporter {
602
573
  return xref;
603
574
  },
604
575
  cross_reference: (node) => {
605
- var _a;
576
+ var _a, _b, _c;
606
577
  const cross = node;
607
578
  const rids = cross.attrs.rids;
608
579
  if (!rids.length) {
609
- return cross.attrs.label;
580
+ return (_a = cross.attrs.label) !== null && _a !== void 0 ? _a : '';
610
581
  }
611
- const text = cross.attrs.customLabel || cross.attrs.label;
612
- const target = (_a = findChildrenByAttr(this.manuscriptNode, (attrs) => attrs.id === rids[0])[0]) === null || _a === void 0 ? void 0 : _a.node;
582
+ const rid = rids[0];
583
+ const text = cross.attrs.label || ((_b = this.labelTargets.get(rid)) === null || _b === void 0 ? void 0 : _b.label);
584
+ const target = (_c = findChildrenByAttr(this.manuscriptNode, (attrs) => attrs.id === rid)[0]) === null || _c === void 0 ? void 0 : _c.node;
613
585
  if (!target) {
614
586
  warn('');
615
- return text;
587
+ return text || '';
616
588
  }
617
589
  const xref = this.document.createElement('xref');
618
590
  const type = chooseRefType(target.type);
@@ -623,7 +595,7 @@ export class JATSExporter {
623
595
  warn(`Unset ref-type for schema type ${target.type.name}`);
624
596
  }
625
597
  xref.setAttribute('rid', normalizeID(rids.join(' ')));
626
- xref.textContent = text;
598
+ xref.textContent = text !== null && text !== void 0 ? text : '';
627
599
  return xref;
628
600
  },
629
601
  doc: () => '',
@@ -1211,22 +1183,6 @@ export class JATSExporter {
1211
1183
  this.fixBody = (body) => {
1212
1184
  this.manuscriptNode.descendants((node) => {
1213
1185
  if (node.attrs.id) {
1214
- if (node.attrs.titleSuppressed) {
1215
- const title = body.querySelector(`#${normalizeID(node.attrs.id)} > title`);
1216
- if (title && title.parentNode) {
1217
- title.parentNode.removeChild(title);
1218
- }
1219
- }
1220
- if (node.attrs.suppressCaption) {
1221
- const caption = body.querySelector(`#${normalizeID(node.attrs.id)} > caption`);
1222
- if (caption) {
1223
- caption.remove();
1224
- }
1225
- const label = body.querySelector(`#${normalizeID(node.attrs.id)} > label`);
1226
- if (label) {
1227
- label.remove();
1228
- }
1229
- }
1230
1186
  if (isNodeType(node, 'general_table_footnote')) {
1231
1187
  const generalTableFootnote = body.querySelector(`#${normalizeID(node.attrs.id)}`);
1232
1188
  if (generalTableFootnote) {
@@ -1242,13 +1198,8 @@ export class JATSExporter {
1242
1198
  for (const childNode of tableElement.childNodes) {
1243
1199
  switch (childNode.nodeName) {
1244
1200
  case 'caption': {
1245
- if (node.attrs.suppressCaption) {
1246
- tableElement.removeChild(childNode);
1247
- }
1248
- else {
1249
- const label = tableElement.querySelector('label');
1250
- tableElement.insertBefore(childNode, label ? label.nextSibling : tableElement.firstChild);
1251
- }
1201
+ const label = tableElement.querySelector('label');
1202
+ tableElement.insertBefore(childNode, label ? label.nextSibling : tableElement.firstChild);
1252
1203
  break;
1253
1204
  }
1254
1205
  case 'table': {
@@ -1292,19 +1243,15 @@ export class JATSExporter {
1292
1243
  const headerCell = row.querySelector('th[scope="col"], th[scope="colgroup"]');
1293
1244
  if (i === 0 || headerCell) {
1294
1245
  tbody === null || tbody === void 0 ? void 0 : tbody.removeChild(row);
1295
- if (!node.attrs.suppressHeader) {
1296
- const tableCells = row.querySelectorAll('td');
1297
- for (const td of tableCells) {
1298
- this.changeTag(td, 'th');
1299
- }
1300
- thead.appendChild(row);
1246
+ const tableCells = row.querySelectorAll('td');
1247
+ for (const td of tableCells) {
1248
+ this.changeTag(td, 'th');
1301
1249
  }
1250
+ thead.appendChild(row);
1302
1251
  }
1303
1252
  else if (i === tbodyRows.length - 1) {
1304
1253
  tbody === null || tbody === void 0 ? void 0 : tbody.removeChild(row);
1305
- if (!node.attrs.suppressFooter) {
1306
- tfoot.appendChild(row);
1307
- }
1254
+ tfoot.appendChild(row);
1308
1255
  }
1309
1256
  }
1310
1257
  });