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): reject unsupported compound lines

hugohe32fb2b893ca70
diff --git a/docs/powerpoint-svg-mapping.md b/docs/powerpoint-svg-mapping.md
index 959ffdcb..950f70c3 100644
--- a/docs/powerpoint-svg-mapping.md
+++ b/docs/powerpoint-svg-mapping.md
@@ -154,6 +154,7 @@ preset selection and authoring behavior are documented in
| Pattern fill | Annotated project pattern definition | Native `a:pattFill` | `Native-normalized` | Only registered PowerPoint preset patterns are supported |
| No outline | `stroke="none"` or the registered absence of a line | `a:noFill` under `a:ln` | `Native-stable` | Do not simulate absence with zero-width ambiguous CSS |
| Solid outline | Registered `stroke` and width | Native `a:ln` | `Native-stable` | Width and paint must use canonical units/grammar |
+| Compound outline | No registered single-stroke SVG representation | Explicit geometry alternative or baked asset | `Bake-required` for the compound-line identity | PPTX import accepts only omitted/`sng` `cmpd`; other source values stop instead of becoming a single line |
| Outline scaling under transforms | Exact `vector-effect="none"` or `vector-effect="non-scaling-stroke"` | Choice resolved into native line width | `Native-normalized` | Other values are rejected; generated spelling is exact and lowercase |
| Dashed or dotted outline | Registered dash array | Preset or custom DrawingML dash | `Native-normalized` | Unsupported dash semantics are rejected |
| Line cap and join | Registered cap/join values | Native line cap/join properties | `Native-stable` | Only documented values are accepted |
diff --git a/docs/zh/powerpoint-svg-mapping.md b/docs/zh/powerpoint-svg-mapping.md
index f1444575..933b9e56 100644
--- a/docs/zh/powerpoint-svg-mapping.md
+++ b/docs/zh/powerpoint-svg-mapping.md
@@ -149,6 +149,7 @@ PowerPoint 意图
| 图案填充 | 带注解的项目 pattern 定义 | 原生 `a:pattFill` | `Native-normalized` | 仅支持已登记 PowerPoint 预设 pattern |
| 无轮廓 | `stroke="none"` 或已登记线缺省 | `a:ln` 内的 `a:noFill` | `Native-stable` | 不得用零线宽模糊 CSS 模拟缺省 |
| 实线轮廓 | 已登记 `stroke` 与宽度 | 原生 `a:ln` | `Native-stable` | 宽度与 paint 必须使用规范单位/语法 |
+| 复合轮廓线 | 无已登记的单一 SVG stroke 表达 | 显式几何替代或烘焙资产 | 复合线身份为 `Bake-required` | PPTX 回导仅接受省略/`sng` 的 `cmpd`;其他源值会阻断,不得退化为单线 |
| transform 下的轮廓缩放 | 精确的 `vector-effect="none"` 或 `vector-effect="non-scaling-stroke"` | 选择被解析为原生线宽 | `Native-normalized` | 拒绝其他取值;生成拼法必须精确且为小写 |
| 虚线或点线轮廓 | 已登记 dash array | 预设或自定义 DrawingML dash | `Native-normalized` | 拒绝不支持的 dash 语义 |
| 线端与连接样式 | 已登记 cap/join 值 | 原生 line cap/join 属性 | `Native-stable` | 仅接受文档化取值 |
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 3b9503cf..210e58d7 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -994,6 +994,9 @@ from `0` through `20116800` EMU. Malformed, negative, or oversized source widths
stop import instead of being dropped and replaced by a default SVG line width.
The EMU-to-pixel token retains enough decimal precision for the smallest
positive legal width to remain non-zero and quantize back to its source EMU.
+PPTX import accepts an omitted `a:ln@cmpd` or explicit `sng`. Other compound
+line values (`dbl`, `thickThin`, `thinThick`, `tri`) have no registered
+single-stroke SVG mapping and stop import instead of becoming an ordinary line.
An explicit source `a:ln@cap` must be `flat`, `rnd`, or `sq`, which map to SVG
`butt`, `round`, and `square`; unknown values stop import instead of falling
back to the SVG default cap.
diff --git a/skills/ppt-master/scripts/pptx_to_svg/ln_to_svg.py b/skills/ppt-master/scripts/pptx_to_svg/ln_to_svg.py
index 18621f80..371ab3e9 100644
--- a/skills/ppt-master/scripts/pptx_to_svg/ln_to_svg.py
+++ b/skills/ppt-master/scripts/pptx_to_svg/ln_to_svg.py
@@ -75,6 +75,12 @@ def resolve_stroke(
attrs: dict[str, str] = {}
defs: list[str] = []
+ compound = ln.attrib.get("cmpd")
+ if compound not in {None, "sng"}:
+ raise ValueError(
+ f"Unsupported DrawingML compound line: {compound!r}"
+ )
+
# Width (a:ln@w in EMU)
width_emu = ln.attrib.get("w")
if width_emu is not None:
diff --git a/skills/ppt-master/scripts/test_svg_quality_checker.py b/skills/ppt-master/scripts/test_svg_quality_checker.py
index 25cb766c..4e644c1a 100644
--- a/skills/ppt-master/scripts/test_svg_quality_checker.py
+++ b/skills/ppt-master/scripts/test_svg_quality_checker.py
@@ -2681,6 +2681,27 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):
stroke_xml = build_stroke_xml(line, ConvertContext())
self.assertIn('<a:ln w="1">', stroke_xml)
+ def test_compound_native_line_is_rejected_on_import(self):
+ for compound in ('dbl', 'thickThin', 'thinThick', 'tri'):
+ with self.subTest(compound=compound):
+ sp_pr = ET.fromstring(f'''
+<p:spPr xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"
+ xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
+ <a:ln cmpd="{compound}"/>
+</p:spPr>''')
+ with self.assertRaisesRegex(
+ ValueError,
+ f"Unsupported DrawingML compound line: '{compound}'",
+ ):
+ resolve_stroke(sp_pr, None)
+
+ single = ET.fromstring('''
+<p:spPr xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"
+ xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
+ <a:ln cmpd="sng"/>
+</p:spPr>''')
+ self.assertEqual(resolve_stroke(single, None).attrs, {})
+
def test_unknown_native_line_cap_is_rejected_on_import(self):
sp_pr = ET.fromstring('''
<p:spPr xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"