docxmlater 11.0.9 → 11.0.10

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.
@@ -2666,18 +2666,18 @@ export class DocumentParser {
2666
2666
  if (!runsByParagraph.has(fr.paragraphIndex)) {
2667
2667
  runsByParagraph.set(fr.paragraphIndex, new Set());
2668
2668
  }
2669
- runsByParagraph.get(fr.paragraphIndex).add(fr.runIndex);
2669
+ runsByParagraph.get(fr.paragraphIndex).add(fr.run);
2670
2670
  }
2671
2671
  const affectedParagraphIndices = Array.from(runsByParagraph.keys()).sort((a, b) => a - b);
2672
2672
  for (const pIdx of affectedParagraphIndices) {
2673
2673
  const paragraph = allParagraphs[pIdx];
2674
- const runIndicesToRemove = runsByParagraph.get(pIdx);
2674
+ const runsToRemove = runsByParagraph.get(pIdx);
2675
2675
  const content = paragraph.getContent();
2676
2676
  if (pIdx === targetParagraphIndex) {
2677
2677
  const newContent = [];
2678
2678
  let hyperlinkInserted = false;
2679
2679
  for (let rIdx = 0; rIdx < content.length; rIdx++) {
2680
- if (runIndicesToRemove.has(rIdx)) {
2680
+ if (runsToRemove.has(content[rIdx])) {
2681
2681
  if (!hyperlinkInserted) {
2682
2682
  newContent.push(hyperlink);
2683
2683
  hyperlinkInserted = true;
@@ -2690,7 +2690,7 @@ export class DocumentParser {
2690
2690
  paragraph.setContent(newContent);
2691
2691
  }
2692
2692
  else {
2693
- const newContent = content.filter((_, rIdx) => !runIndicesToRemove.has(rIdx));
2693
+ const newContent = content.filter((item) => !runsToRemove.has(item));
2694
2694
  paragraph.setContent(newContent);
2695
2695
  }
2696
2696
  }