@file-viewer/docx 0.3.34 → 0.3.35

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.
@@ -5973,7 +5973,7 @@
5973
5973
  row.className = values.classNameOfCnfStyle(c);
5974
5974
  break;
5975
5975
  case "tblHeader":
5976
- row.isHeader = globalXmlParser.boolAttr(c, "val");
5976
+ row.isHeader = globalXmlParser.boolAttr(c, "val", true);
5977
5977
  break;
5978
5978
  case "gridBefore":
5979
5979
  row.gridBefore = globalXmlParser.intAttr(c, "val");
@@ -8702,6 +8702,7 @@
8702
8702
  this.tableCellPositions = [];
8703
8703
  this.currentCellPosition = null;
8704
8704
  this.currentTableRow = null;
8705
+ this.repeatedTableHeaderRows = new WeakSet();
8705
8706
  this.footnoteMap = {};
8706
8707
  this.endnoteMap = {};
8707
8708
  this.currentEndnoteIds = [];
@@ -8755,6 +8756,7 @@
8755
8756
  this.endnoteMap = {};
8756
8757
  this.noteNumbering = new NoteNumbering();
8757
8758
  this.renderedNoteIds = new Set();
8759
+ this.repeatedTableHeaderRows = new WeakSet();
8758
8760
  this.noteSectionIds = new Map();
8759
8761
  this.notePageIndex = 1;
8760
8762
  this.dynamicNoteState = new WeakMap();
@@ -9539,8 +9541,14 @@
9539
9541
  return;
9540
9542
  const continuation = result.length > 0;
9541
9543
  let fragmentRows = currentRows;
9542
- if (continuation && headerRows.length > 0 && !currentRows.some(row => row.isHeader))
9543
- fragmentRows = [...headerRows, ...currentRows];
9544
+ if (continuation && headerRows.length > 0 && !currentRows.some(row => row.isHeader)) {
9545
+ const repeatedHeaders = headerRows.map(row => {
9546
+ const copy = { ...row };
9547
+ this.repeatedTableHeaderRows.add(copy);
9548
+ return copy;
9549
+ });
9550
+ fragmentRows = [...repeatedHeaders, ...currentRows];
9551
+ }
9544
9552
  result.push({
9545
9553
  table: { ...table, children: fragmentRows },
9546
9554
  breakAfter
@@ -14013,6 +14021,8 @@ section.${c}>footer { z-index: 1; }
14013
14021
  const row = this.toHTML(elem, ns.html, "tr", children);
14014
14022
  if (elem.isHeader)
14015
14023
  row.dataset.docxRepeatHeader = "true";
14024
+ if (this.repeatedTableHeaderRows.has(elem))
14025
+ row.dataset.docxRepeatedHeader = "true";
14016
14026
  return row;
14017
14027
  }
14018
14028
  renderTableCellPlaceholder(colSpan) {