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.
- package/dist/core/DocumentParser.d.ts.map +1 -1
- package/dist/core/DocumentParser.js +4 -4
- package/dist/core/DocumentParser.js.map +1 -1
- package/dist/esm/core/DocumentParser.js +4 -4
- package/dist/esm/core/DocumentParser.js.map +1 -1
- package/package.json +1 -1
- package/src/core/DocumentParser.ts +11 -6
|
@@ -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.
|
|
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
|
|
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 (
|
|
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((
|
|
2693
|
+
const newContent = content.filter((item) => !runsToRemove.has(item));
|
|
2694
2694
|
paragraph.setContent(newContent);
|
|
2695
2695
|
}
|
|
2696
2696
|
}
|