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(svg-contract): allow reversible start markers

hugohe35e3755a7bfcc
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 90f637e6..a9c6d072 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -167,7 +167,7 @@ when the referenced marker fits this native-arrow contract:
| Concern | Required form |
|---|---|
| Reference | Exact local `url(#id)` to a `<marker>` in `<defs>` |
-| Orientation | `orient="auto"` |
+| Orientation | `orient="auto"` or `orient="auto-start-reverse"`; the latter reverses `marker-start` while behaving like `auto` at `marker-end` |
| Shape | A 3-vertex `<polygon>` / closed M/L-only path (triangle), 4-vertex `<polygon>` / closed M/L-only path (diamond), or one `<circle>` / `<ellipse>` (oval) |
| Path grammar | One explicit `M`/`L` command per vertex followed by `Z`; do not use `H`, `V`, curves, or an implicit multi-point `L` command inside a marker path |
| Color parity | Marker fill matches the parent line stroke; DrawingML arrows inherit the line color |
diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.py
index 9edb0a50..96a5f94c 100644
--- a/skills/ppt-master/scripts/svg_quality_checker.py
+++ b/skills/ppt-master/scripts/svg_quality_checker.py
@@ -1912,8 +1912,14 @@ class SVGQualityChecker:
if marker_id not in checked_markers:
checked_markers.add(marker_id)
marker_label = f'<marker id="{marker_id}">'
- if marker.get('orient') != 'auto':
- issues.add(f'{marker_label} requires orient="auto"')
+ if marker.get('orient') not in {
+ 'auto',
+ 'auto-start-reverse',
+ }:
+ issues.add(
+ f'{marker_label} requires orient="auto" or '
+ 'orient="auto-start-reverse"'
+ )
marker_units = marker.get('markerUnits', 'strokeWidth')
if marker_units not in {'strokeWidth', 'userSpaceOnUse'}:
issues.add(
diff --git a/skills/ppt-master/scripts/test_svg_quality_checker.py b/skills/ppt-master/scripts/test_svg_quality_checker.py
index 866fe00c..b7ce620c 100644
--- a/skills/ppt-master/scripts/test_svg_quality_checker.py
+++ b/skills/ppt-master/scripts/test_svg_quality_checker.py
@@ -2536,6 +2536,38 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):
stroke_xml,
)
+ def test_imported_head_end_uses_supported_reversible_orientation(self):
+ drawingml_ns = (
+ 'http://schemas.openxmlformats.org/drawingml/2006/main'
+ )
+ head_end = ET.Element(
+ f'{{{drawingml_ns}}}headEnd',
+ {'type': 'triangle', 'w': 'med', 'len': 'med'},
+ )
+ marker_id, marker_markup = _build_arrow_marker(
+ head_end,
+ '#112233',
+ id_prefix='roundtrip-',
+ seq=[0],
+ reversed_=True,
+ )
+ svg = f'''<svg xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 1280 720">
+ <defs>{marker_markup}</defs>
+ <line x1="80" y1="80" x2="300" y2="80" stroke="#112233"
+ marker-start="url(#{marker_id})"/>
+</svg>'''
+ with tempfile.TemporaryDirectory() as tmp_dir:
+ svg_path = Path(tmp_dir) / 'head-end.svg'
+ svg_path.write_text(svg, encoding='utf-8')
+ checker_result = SVGQualityChecker().check_file(str(svg_path))
+ self.assertEqual(checker_result['errors'], [])
+ slide_xml, *_rest = convert_svg_to_slide_shapes(svg_path)
+ self.assertIn(
+ '<a:headEnd type="triangle" w="med" len="med"/>',
+ slide_xml,
+ )
+
def test_invalid_filter_contract_blocks_checker_and_exporter(self):
self._assert_checker_and_exporter_reject(
'''<svg xmlns="http://www.w3.org/2000/svg"