Preserve QPowerPoint strikethrough in PPTX

This commit is contained in:
Курнат Андрей
2026-06-02 07:46:39 +03:00
parent c4532902c8
commit b117e11431
6 changed files with 65 additions and 11 deletions
+11 -4
View File
@@ -614,9 +614,11 @@ describe("powerPointOffice helpers", () => {
titleBold: true,
titleItalics: true,
titleUnderline: true,
titleStrike: true,
subtitleBold: true,
subtitleItalics: true,
subtitleUnderline: true
subtitleUnderline: true,
subtitleStrike: true
});
const exportedBlob = await exportPptxBlob({
@@ -631,9 +633,11 @@ describe("powerPointOffice helpers", () => {
titleBold: false,
titleItalics: true,
titleUnderline: true,
titleStrike: true,
subtitleBold: true,
subtitleItalics: true,
subtitleUnderline: true
subtitleUnderline: true,
subtitleStrike: true
}
]
});
@@ -642,6 +646,7 @@ describe("powerPointOffice helpers", () => {
expect(exportedSlideXml).toContain('i="1"');
expect(exportedSlideXml).toContain('u="sng"');
expect(exportedSlideXml).toContain('strike="sngStrike"');
expect(exportedSlideXml).toContain('b="1"');
const reimported = await importPptxFile(new File([exportedBlob], "Начертание.pptx", { type: exportedBlob.type }));
@@ -649,9 +654,11 @@ describe("powerPointOffice helpers", () => {
titleBold: false,
titleItalics: true,
titleUnderline: true,
titleStrike: true,
subtitleBold: true,
subtitleItalics: true,
subtitleUnderline: true
subtitleUnderline: true,
subtitleStrike: true
});
});
@@ -743,7 +750,7 @@ function slideXmlWithTextStyles(title: string, subtitle: string) {
}
function slideXmlWithTextRunStyles(title: string, subtitle: string) {
return `<p:sld xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><p:cSld><p:spTree><p:sp><p:txBody><a:p><a:r><a:rPr b="1" i="1" u="sng"/><a:t>${title}</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:txBody><a:p><a:r><a:rPr b="1" i="1" u="sng"/><a:t>${subtitle}</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld></p:sld>`;
return `<p:sld xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><p:cSld><p:spTree><p:sp><p:txBody><a:p><a:r><a:rPr b="1" i="1" u="sng" strike="sngStrike"/><a:t>${title}</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:txBody><a:p><a:r><a:rPr b="1" i="1" u="sng" strike="sngStrike"/><a:t>${subtitle}</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld></p:sld>`;
}
function slideXmlWithTextHyperlinks(title: string, subtitle: string) {