Reimplementing Columns Management
This commit is contained in:
@@ -276,11 +276,14 @@ def _get_attr(x, attr):
|
||||
|
||||
if isinstance(x, NotStr) and attr == "s":
|
||||
# Special case for NotStr: return the name of the svg
|
||||
svg = getattr(x, attr, MISSING_ATTR)
|
||||
match = re.search(r'name\s*=\s*["\']([^"\']+)["\']', svg)
|
||||
if match:
|
||||
return f'<svg name="{match.group(1)}" />'
|
||||
|
||||
attr_value = getattr(x, attr, MISSING_ATTR)
|
||||
if attr_value.strip().startswith("<svg "):
|
||||
match = re.search(r'name\s*=\s*["\']([^"\']+)["\']', attr_value)
|
||||
if match:
|
||||
return f'<svg name="{match.group(1)}" />'
|
||||
else:
|
||||
return attr_value
|
||||
|
||||
return getattr(x, attr, MISSING_ATTR)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user