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(embed-icons): detect single-quoted stroke icons as stroke icons

hugohe30cdf8765a571
diff --git a/skills/ppt-master/scripts/svg_finalize/embed_icons.py b/skills/ppt-master/scripts/svg_finalize/embed_icons.py
index 733831f6..aed2c62b 100644
--- a/skills/ppt-master/scripts/svg_finalize/embed_icons.py
+++ b/skills/ppt-master/scripts/svg_finalize/embed_icons.py
@@ -160,8 +160,11 @@ def _is_preserve_color_asset(content: str) -> bool:
def _detect_icon_style(content: str) -> str:
"""Detect whether an icon is fill-based or stroke-based."""
- # stroke="currentColor" with fill="none" → stroke style
- if 'stroke="currentColor"' in content and 'fill="none"' in content:
+ # stroke="currentColor" with fill="none" → stroke style (either quote)
+ if (
+ re.search(r'stroke\s*=\s*["\']currentColor["\']', content)
+ and re.search(r'fill\s*=\s*["\']none["\']', content)
+ ):
return 'stroke'
return 'fill'
diff --git a/skills/ppt-master/scripts/tests/test_embed_icons.py b/skills/ppt-master/scripts/tests/test_embed_icons.py
index 86f00cef..8b69fd52 100644
--- a/skills/ppt-master/scripts/tests/test_embed_icons.py
+++ b/skills/ppt-master/scripts/tests/test_embed_icons.py
@@ -138,3 +138,10 @@ class PreserveColorMarkerTests(unittest.TestCase):
self.assertEqual(style, "preserve")
self.assertIn("#ff0000", "".join(parts))
self.assertIn("<text>", "".join(parts))
+
+ def test_single_quoted_stroke_icon_is_detected_as_stroke(self) -> None:
+ icon = "<svg viewBox='0 0 24 24' fill='none' stroke='currentColor'><path d='M4 12h16'/></svg>"
+ with patch.object(Path, "exists", return_value=True), \
+ patch.object(Path, "read_text", return_value=icon):
+ _, style, _ = extract_paths_from_icon(Path("arrow.svg"))
+ self.assertEqual(style, "stroke")