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: table parity lets explicit run colour and weight override the cell default

hugohe3aee33e5a0f6e
diff --git a/skills/ppt-master/scripts/svg_to_pptx/native_objects/table.py b/skills/ppt-master/scripts/svg_to_pptx/native_objects/table.py
index 297698fc..2252eb0d 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/native_objects/table.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/native_objects/table.py
@@ -846,11 +846,13 @@ def _table_cell_parity_text_style(
if runs and None not in run_colors and len(run_colors) == 1:
uniform_color = run_colors.pop()
- bold = cell_data.get("bold") if "bold" in cell_data else uniform_bold
+ # Explicit run properties override the cell's (as the export writes them),
+ # so a cell whose every run carries one value renders in that value.
+ bold = uniform_bold if uniform_bold is not None else cell_data.get("bold")
color = (
- _hex_or_none(cell_data.get("color"))
- if "color" in cell_data
- else uniform_color
+ uniform_color
+ if uniform_color is not None
+ else _hex_or_none(cell_data.get("color"))
)
return bold, color
diff --git a/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py b/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
index ed836008..9f061703 100644
--- a/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
+++ b/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
@@ -507,6 +507,12 @@ class RtlAndTemplateExportTests(unittest.TestCase):
self.assertEqual((whole.fill, whole.bold), ("5E7D4F", True))
self.assertEqual(mixed.fill, "2B1D15")
+ def test_explicit_run_colour_beats_cell_default(self) -> None:
+ from svg_to_pptx.native_objects.table import _table_cell_parity_text_style
+ cell = {"color": "#2B1D15", "paragraphs": [
+ {"runs": [{"text": "الهيل", "bold": True, "color": "#5E7D4F"}]}]}
+ self.assertEqual(_table_cell_parity_text_style(cell), (True, "5E7D4F"))
+
def test_rtl_template_levels_flip(self) -> None:
from svg_to_pptx.pptx_package.builder import _rtl_text_levels
xml = '<a:lvl1pPr marL="0" algn="l" rtl="0"/><a:lvl1pPr algn="ctr" rtl="0"/>'