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): enforce the fixed line-join contract
hugohe3be8b437863b1
diff --git a/docs/powerpoint-svg-mapping.md b/docs/powerpoint-svg-mapping.mdindex bb521ce8..4136b6c4 100644--- a/docs/powerpoint-svg-mapping.md+++ b/docs/powerpoint-svg-mapping.md@@ -158,7 +158,7 @@ preset selection and authoring behavior are documented in| Inside-aligned outline | No registered ordinary SVG stroke representation | Explicit inset geometry or baked asset | `Bake-required` for exact outline alignment | PPTX import accepts only omitted/`ctr` `algn`; `in` stops instead of becoming a centered stroke || 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 |+| Line cap and join | Registered cap/join values | Native line cap/join properties | `Native-stable` within the fixed join contract | Import accepts one join; miter requires exact `lim="800000"` || Line arrowheads | Registered start/end markers | Native head/tail end properties | `Approximate` for marker size | Only triangle, stealth, arrow, diamond, and oval follow 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 |diff --git a/docs/zh/powerpoint-svg-mapping.md b/docs/zh/powerpoint-svg-mapping.mdindex 50883761..3f46c95a 100644--- a/docs/zh/powerpoint-svg-mapping.md+++ b/docs/zh/powerpoint-svg-mapping.md@@ -153,7 +153,7 @@ PowerPoint 意图| 内侧对齐轮廓 | 无已登记的普通 SVG stroke 表达 | 显式内缩几何或烘焙资产 | 精确轮廓对齐为 `Bake-required` | PPTX 回导仅接受省略/`ctr` 的 `algn`;`in` 会阻断,不得退化为居中描边 || 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` | 仅接受文档化取值 |+| 线端与连接样式 | 已登记 cap/join 值 | 原生 line cap/join 属性 | 固定 join 合同内为 `Native-stable` | 回导仅接受一个 join;miter 必须精确使用 `lim="800000"` || 线条箭头 | 已登记起点/终点 marker | 原生 head/tail end 属性 | marker 大小为 `Approximate` | 仅 triangle、stealth、arrow、diamond、oval 遵循条件 marker 合同 || 外阴影 | 一个受支持 shadow filter 图 | `a:effectLst` 中的原生外阴影 | `Approximate`;仅当非零偏移仍可稳定分类时,才重建单一 shape/connector 来源 `outerShdw` | 零偏移来源阴影和不支持的图结构不会被静默改成其他效果 || 发光 | 一个受支持 glow filter 图 | `a:effectLst` 中的原生发光 | `Approximate`;单一 shape/connector 来源发光保持已登记的半径换算 | 发光承载语义强调时需复核 |diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex 13ebd626..20c07224 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -1003,6 +1003,10 @@ SVG stroke is centered and cannot preserve the source outline boundary.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 fallingback to the SVG default cap.+An imported line has at most one direct `a:round`, `a:bevel`, or `a:miter`+join. Round and bevel are empty; miter requires the project's fixed+`lim="800000"`. Ambiguous joins, payload-bearing join elements, a missing+limit, and other miter limits stop import rather than losing corner geometry.PPTX import maps only the registered DrawingML `prstDash` values; `solid`remains an intentional line with no SVG dash array, while an unknown sourcevalue stops import instead of being mistaken for `solid`.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.pyindex 8d1d5595..e8206565 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@@ -184,12 +184,30 @@ def resolve_stroke(attrs["stroke-dasharray"] = " ".join(ds_parts)# Join- if ln.find("a:round", NS) is not None:- attrs["stroke-linejoin"] = "round"- elif ln.find("a:bevel", NS) is not None:- attrs["stroke-linejoin"] = "bevel"- elif ln.find("a:miter", NS) is not None:- attrs["stroke-linejoin"] = "miter"+ join_names = {+ f"{{{NS['a']}}}round": "round",+ f"{{{NS['a']}}}bevel": "bevel",+ f"{{{NS['a']}}}miter": "miter",+ }+ joins = [child for child in ln if child.tag in join_names]+ if len(joins) > 1:+ raise ValueError("DrawingML line must contain at most one join")+ if joins:+ join = joins[0]+ linejoin = join_names[join.tag]+ if list(join):+ raise ValueError("Invalid DrawingML line join structure")+ if linejoin in {"round", "bevel"} and join.attrib:+ raise ValueError("Invalid DrawingML line join structure")+ if linejoin == "miter":+ if set(join.attrib) - {"lim"}:+ raise ValueError("Invalid DrawingML line join structure")+ limit = join.attrib.get("lim")+ if limit != "800000":+ raise ValueError(+ f"Unsupported DrawingML miter limit: {limit!r}"+ )+ attrs["stroke-linejoin"] = linejoin# Arrow markers (head / tail)if id_seq is None:diff --git a/skills/ppt-master/scripts/test_svg_quality_checker.py b/skills/ppt-master/scripts/test_svg_quality_checker.pyindex 8088ef97..97368708 100644--- a/skills/ppt-master/scripts/test_svg_quality_checker.py+++ b/skills/ppt-master/scripts/test_svg_quality_checker.py@@ -2735,6 +2735,43 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):):resolve_stroke(sp_pr, None)+ def test_native_line_join_requires_unambiguous_default_geometry(self):+ invalid_cases = (+ (+ '<a:round/><a:bevel/>',+ 'DrawingML line must contain at most one join',+ ),+ (+ '<a:round unexpected="1"/>',+ 'Invalid DrawingML line join structure',+ ),+ (+ '<a:miter lim="400000"/>',+ "Unsupported DrawingML miter limit: '400000'",+ ),+ (+ '<a:miter/>',+ 'Unsupported DrawingML miter limit: None',+ ),+ )+ for join_markup, expected in invalid_cases:+ with self.subTest(join_markup=join_markup):+ 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>{join_markup}</a:ln>+</p:spPr>''')+ with self.assertRaisesRegex(ValueError, expected):+ resolve_stroke(sp_pr, None)++ sp_pr = ET.fromstring('''+<p:spPr xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"+ xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">+ <a:ln><a:miter lim="800000"/></a:ln>+</p:spPr>''')+ stroke = resolve_stroke(sp_pr, None)+ self.assertEqual(stroke.attrs['stroke-linejoin'], 'miter')+def test_unknown_native_preset_dash_is_rejected_on_import(self):sp_pr = ET.fromstring('''<p:spPr xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"