Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(pptx-to-svg): block relationship text run-effect loss

hugohe328b3f5da18a5
diff --git a/docs/powerpoint-svg-mapping.md b/docs/powerpoint-svg-mapping.md
index 622f0bdf..2e146915 100644
--- a/docs/powerpoint-svg-mapping.md
+++ b/docs/powerpoint-svg-mapping.md
@@ -160,7 +160,7 @@ preset selection and authoring behavior are documented in
| Line arrowheads | Registered start/end markers | Native head/tail end properties | `Approximate` for marker size | See the conditional marker contract |
| Outer shadow | One supported shadow filter graph | Native outer shadow in `a:effectLst` | `Approximate`; one imported shape/connector source `outerShdw` is reconstructed only when its non-zero offset remains classifiable | Zero-offset source shadows and unsupported graph shapes are not silently reclassified |
| Glow | One supported glow filter graph | Native glow in `a:effectLst` | `Approximate`; one imported shape/connector source glow keeps the registered radius conversion | Review when the glow carries semantic emphasis |
-| Imported text-run effect | Unchanged `metadata[data-pptx-part="txbody"]` on a logical shape; import-only blocking effect status for separate vertical-text output | Original native run effect inside `p:txBody` | `Native-stable` only while the raw payload remains usable; edits or vertical-text normalization that would drop a non-empty run `effectLst` / `effectDag` block | Not public authoring syntax; relationship-bearing text bodies and table-cell text bodies remain outside this guard |
+| Imported text-run effect | Unchanged `metadata[data-pptx-part="txbody"]` on a logical shape; import-only blocking effect status for separate vertical-text and relationship-bearing output | Original native run effect inside `p:txBody` | `Native-stable` only while the raw payload remains usable; edits or fallback routes that would drop a non-empty run `effectLst` / `effectDag` block | Not public authoring syntax; table-cell text bodies remain outside this guard |
| Whole-object transparency | Atomic element `opacity` | Alpha distributed into supported native channels | `Native-normalized` | Prefer channel-specific alpha unless the whole atomic object fades |
| Group transparency | Compatible `<g opacity>` | Descendant-normalized approximation | `Approximate` with a warning | Generated SVG should prefer descendant alpha |
| Inner shadow, soft edge, reflection, blur, turbulence, blend mode, or arbitrary mask | No registered native mapping | Explicit geometry alternative or raster asset | `Bake-required`; PPTX import keeps the base object and emits blocking diagnostics for unsupported shape/connector effects, picture/group effect DAGs, and non-empty picture/group effect lists | Handled object effects cannot be reclassified or omitted; text-run safety follows the unchanged-`txBody` row above |
diff --git a/docs/zh/powerpoint-svg-mapping.md b/docs/zh/powerpoint-svg-mapping.md
index 0f2347b5..0b31e0a8 100644
--- a/docs/zh/powerpoint-svg-mapping.md
+++ b/docs/zh/powerpoint-svg-mapping.md
@@ -155,7 +155,7 @@ PowerPoint 意图
| 线条箭头 | 已登记起点/终点 marker | 原生 head/tail end 属性 | marker 大小为 `Approximate` | 见条件 marker 合同 |
| 外阴影 | 一个受支持 shadow filter 图 | `a:effectLst` 中的原生外阴影 | `Approximate`;仅当非零偏移仍可稳定分类时,才重建单一 shape/connector 来源 `outerShdw` | 零偏移来源阴影和不支持的图结构不会被静默改成其他效果 |
| 发光 | 一个受支持 glow filter 图 | `a:effectLst` 中的原生发光 | `Approximate`;单一 shape/connector 来源发光保持已登记的半径换算 | 发光承载语义强调时需复核 |
-| 导入的文字 run 效果 | 逻辑 shape 上未变更的 `metadata[data-pptx-part="txbody"]`;独立竖排输出使用仅限导入的阻塞效果状态 | `p:txBody` 内原始原生 run 效果 | 仅在原始 payload 仍可用时为 `Native-stable`;会丢失非空 run `effectLst` / `effectDag` 的编辑或竖排文本规范化将被阻断 | 不是公开创作语法;含关系引用的文本内容及表格单元格文本尚不在该保护范围内 |
+| 导入的文字 run 效果 | 逻辑 shape 上未变更的 `metadata[data-pptx-part="txbody"]`;独立竖排及含关系引用的输出使用仅限导入的阻塞效果状态 | `p:txBody` 内原始原生 run 效果 | 仅在原始 payload 仍可用时为 `Native-stable`;会丢失非空 run `effectLst` / `effectDag` 的编辑或降级路径将被阻断 | 不是公开创作语法;表格单元格文本尚不在该保护范围内 |
| 整个对象透明度 | 原子元素 `opacity` | alpha 分发至受支持原生通道 | `Native-normalized` | 除非整个原子对象需要淡出,否则优先通道专属 alpha |
| 组透明度 | 兼容 `<g opacity>` | 后代归一化近似 | `Approximate`,并产生 warning | 生成 SVG 应优先后代 alpha |
| 内阴影、柔化边缘、倒影、模糊、湍流、混合模式或任意 mask | 无已登记原生映射 | 显式几何替代或栅格资产 | `Bake-required`;PPTX 回导保留基础对象,并对不支持的 shape/connector 效果、图片/组效果 DAG 及非空图片/组效果列表产生阻塞诊断 | 已处理的对象效果不能被改成其他类型或静默省略;文字 run 安全边界见上方未变更 `txBody` 行 |
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 2b334714..897263d5 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -794,8 +794,13 @@ text body contains the same non-empty run-effect containers, import keeps the
normalized geometry and visible vertical text but stamps the logical shape and
native carrier with the blocking §1.4 effect status; effect-free and empty
effect containers keep the existing normalized fallback.
+Relationship-bearing text bodies also cannot carry the opaque payload across
+parts. When such a body contains a non-empty run effect, import keeps its
+rebuilt visible text but stamps the same two blocking object markers;
+relationship-bearing text without a run effect keeps the existing visual
+fallback.
This conditional guard is not a public run-effect authoring surface and does
-not cover relationship-bearing text bodies or table-cell text bodies.
+not cover table-cell text bodies.
The quality checker and exporter preflight enforce the same definition,
reference, primitive, target, and numeric-value contract; malformed values are
never replaced by effect defaults during native export.
diff --git a/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py b/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py
index ee05ca23..b88b0283 100644
--- a/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py
+++ b/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py
@@ -346,10 +346,16 @@ def _convert_shape(node: ShapeNode, ctx: AssemblyContext, *, top_level: bool) ->
# Text body (a:txBody)
tx_body = node.xml.find("p:txBody", NS)
is_vertical = is_vertical_txbody(tx_body, node.xfrm)
- if is_vertical and geom is not None and txbody_has_run_effects(tx_body):
- geom.attrs.update(unsupported_effect_metadata(
- "unsupported-run-effect-route:vertical-text"
- ))
+ has_run_effects = txbody_has_run_effects(tx_body)
+ if geom is not None and has_run_effects:
+ if is_vertical:
+ geom.attrs.update(unsupported_effect_metadata(
+ "unsupported-run-effect-route:vertical-text"
+ ))
+ elif tx_body is not None and has_relationship_attributes(tx_body):
+ geom.attrs.update(unsupported_effect_metadata(
+ "unsupported-run-effect-route:relationship-bearing-text"
+ ))
# Geometry (fill is "none" when blipFill is present, so only stroke draws)
geom_xml = _build_geometry_xml(node, sp_pr, ctx, geom=geom)
diff --git a/skills/ppt-master/scripts/test_svg_quality_checker.py b/skills/ppt-master/scripts/test_svg_quality_checker.py
index 5e63e4b4..28b25736 100644
--- a/skills/ppt-master/scripts/test_svg_quality_checker.py
+++ b/skills/ppt-master/scripts/test_svg_quality_checker.py
@@ -337,6 +337,80 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):
target.writestr(info, replacements.get(info.filename, data))
rewritten.replace(path)
+ @staticmethod
+ def _write_relationship_run_effect_fixture(
+ path: Path,
+ cases: list[tuple[str | None, bool]],
+ ) -> None:
+ """Write text slides with optional hyperlinks and run effects."""
+ presentation = Presentation()
+ blank = presentation.slide_layouts[6]
+ for index, (_effect, has_relationship) in enumerate(cases, start=1):
+ slide = presentation.slides.add_slide(blank)
+ shape = slide.shapes.add_shape(
+ MSO_SHAPE.RECTANGLE,
+ Emu(914400),
+ Emu(914400),
+ Emu(2743200),
+ Emu(914400),
+ )
+ shape.name = f'RELATIONSHIP EFFECT TEXT {index}'
+ paragraph = shape.text_frame.paragraphs[0]
+ run = paragraph.add_run()
+ run.text = f'LINK {index}'
+ if has_relationship:
+ run.hyperlink.address = 'https://example.com/'
+ presentation.save(path)
+
+ pml = 'http://schemas.openxmlformats.org/presentationml/2006/main'
+ dml = 'http://schemas.openxmlformats.org/drawingml/2006/main'
+ with zipfile.ZipFile(path, 'r') as source:
+ members = [
+ (info, source.read(info.filename))
+ for info in source.infolist()
+ ]
+ member_data = {info.filename: data for info, data in members}
+ replacements: dict[str, bytes] = {}
+
+ for index, (effect_xml, _has_relationship) in enumerate(
+ cases,
+ start=1,
+ ):
+ slide_part = f'ppt/slides/slide{index}.xml'
+ slide_root = ET.fromstring(member_data[slide_part])
+ target = next(
+ shape
+ for shape in slide_root.findall(f'.//{{{pml}}}sp')
+ if (
+ shape.find(f'{{{pml}}}nvSpPr/{{{pml}}}cNvPr')
+ is not None
+ and shape.find(
+ f'{{{pml}}}nvSpPr/{{{pml}}}cNvPr'
+ ).get('name') == f'RELATIONSHIP EFFECT TEXT {index}'
+ )
+ )
+ run = target.find(f'.//{{{dml}}}r')
+ assert run is not None
+ run_properties = run.find(f'{{{dml}}}rPr')
+ if run_properties is None:
+ run_properties = ET.Element(f'{{{dml}}}rPr')
+ run.insert(0, run_properties)
+ if effect_xml is not None:
+ # CT_TextCharacterProperties orders the effect group before
+ # hlinkClick / hlinkMouseOver / extLst.
+ run_properties.insert(0, ET.fromstring(effect_xml))
+ replacements[slide_part] = ET.tostring(
+ slide_root,
+ encoding='utf-8',
+ xml_declaration=True,
+ )
+
+ rewritten = path.with_name(f'{path.stem}-rewritten.pptx')
+ with zipfile.ZipFile(rewritten, 'w') as target:
+ for info, data in members:
+ target.writestr(info, replacements.get(info.filename, data))
+ rewritten.replace(path)
+
@classmethod
def _write_picture_group_effect_fixture(cls, path: Path) -> None:
"""Write one real picture and one group with source effects."""
@@ -2698,6 +2772,98 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):
self.assertTrue(checker_result['passed'])
convert_svg_to_slide_shapes(svg_path)
+ def test_relationship_text_run_effect_import_fails_closed(self):
+ dml = 'http://schemas.openxmlformats.org/drawingml/2006/main'
+ run_effect = f'''<a:effectLst xmlns:a="{dml}">
+ <a:glow rad="38100"><a:srgbClr val="2563EB"/></a:glow>
+</a:effectLst>'''
+ cases = [
+ (run_effect, True),
+ (f'<a:effectLst xmlns:a="{dml}"/>', True),
+ (f'<a:effectDag xmlns:a="{dml}"/>', True),
+ (None, True),
+ (run_effect, False),
+ ]
+ with tempfile.TemporaryDirectory() as tmp_dir:
+ root_dir = Path(tmp_dir)
+ pptx_path = root_dir / 'relationship-run-effects.pptx'
+ self._write_relationship_run_effect_fixture(pptx_path, cases)
+ imported = convert_pptx_to_svg(
+ pptx_path,
+ options=ConvertOptions(inheritance_mode='flat'),
+ )
+ self.assertEqual(len(imported.slides), 5)
+
+ effect_svg = imported.slides[0].svg
+ effect_root = ET.fromstring(effect_svg)
+ self.assertIn('LINK 1', ''.join(effect_root.itertext()))
+ self.assertFalse(any(
+ elem.get('data-pptx-part') == 'txbody'
+ for elem in effect_root.iter()
+ ))
+ marked = [
+ elem
+ for elem in effect_root.iter()
+ if elem.get('data-pptx-effect-status') == 'unsupported'
+ ]
+ self.assertEqual(len(marked), 2)
+ self.assertEqual(
+ {elem.get('data-pptx-effect-reason') for elem in marked},
+ {'unsupported-run-effect-route:relationship-bearing-text'},
+ )
+ status_errors = project_effect_status_errors(effect_root)
+ self.assertEqual(len(status_errors), 1)
+ self.assertIn(
+ 'unsupported-run-effect-route:relationship-bearing-text',
+ status_errors[0],
+ )
+ self._assert_checker_and_exporter_reject(
+ effect_svg,
+ 'unsupported-run-effect-route:relationship-bearing-text',
+ 'unsupported imported PPTX effect',
+ )
+
+ for artifact in imported.slides[1:4]:
+ with self.subTest(slide=artifact.index):
+ plain_root = ET.fromstring(artifact.svg)
+ self.assertIn(
+ f'LINK {artifact.index}',
+ ''.join(plain_root.itertext()),
+ )
+ self.assertFalse(any(
+ elem.get('data-pptx-part') == 'txbody'
+ for elem in plain_root.iter()
+ ))
+ self.assertEqual(
+ project_effect_status_errors(plain_root),
+ [],
+ )
+ self.assertFalse(any(
+ elem.get('data-pptx-effect-status') is not None
+ for elem in plain_root.iter()
+ ))
+ plain_path = (
+ root_dir / f'relationship-{artifact.index}.svg'
+ )
+ plain_path.write_text(artifact.svg, encoding='utf-8')
+ checker_result = SVGQualityChecker().check_file(
+ str(plain_path)
+ )
+ self.assertTrue(checker_result['passed'])
+ convert_svg_to_slide_shapes(plain_path)
+
+ native_svg = imported.slides[4].svg
+ native_root = ET.fromstring(native_svg)
+ self.assertTrue(any(
+ elem.get('data-pptx-part') == 'txbody'
+ for elem in native_root.iter()
+ ))
+ self.assertEqual(project_effect_status_errors(native_root), [])
+ native_path = root_dir / 'relationship-control.svg'
+ native_path.write_text(native_svg, encoding='utf-8')
+ native_xml = convert_svg_to_slide_shapes(native_path)[0]
+ self.assertEqual(native_xml.count('<a:glow'), 1)
+
def test_picture_and_group_effect_import_is_explicit(self):
dml = 'http://schemas.openxmlformats.org/drawingml/2006/main'
empty_sp_pr = ET.fromstring(