File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -566,7 +566,7 @@ def _translate(self):
566
566
"body" : body ,
567
567
"uuid" : uuid ,
568
568
"precision" : precision ,
569
- "table_styles" : table_styles ,
569
+ "table_styles" : _format_table_styles ( table_styles ) ,
570
570
"caption" : caption ,
571
571
"table_attributes" : table_attr ,
572
572
}
@@ -2077,6 +2077,26 @@ def _maybe_convert_css_to_tuples(style: CSSProperties) -> CSSList:
2077
2077
return style
2078
2078
2079
2079
2080
+ def _format_table_styles (styles : CSSStyles ) -> CSSStyles :
2081
+ """
2082
+ looks for multiple CSS selectors and separates them:
2083
+ [{'selector': 'td, th', 'props': 'a:v;'}]
2084
+ ---> [{'selector': 'td', 'props': 'a:v;'},
2085
+ {'selector': 'th', 'props': 'a:v;'}]
2086
+ """
2087
+ return [
2088
+ item
2089
+ for sublist in [
2090
+ [
2091
+ {"selector" : x , "props" : style ["props" ]}
2092
+ for x in style ["selector" ].split ("," )
2093
+ ]
2094
+ for style in styles
2095
+ ]
2096
+ for item in sublist
2097
+ ]
2098
+
2099
+
2080
2100
def _non_reducing_slice (slice_ ):
2081
2101
"""
2082
2102
Ensure that a slice doesn't reduce to a Series or Scalar.
You can’t perform that action at this time.
0 commit comments