[PATCH] Upstream patch - 26022023

This commit is contained in:
Parthiv Patel committed 2023-02-26 08:34:36 +00:00
1 parent 7d8de9bd7f
commit cd6b5bbd2a
22 files changed
+178 -83

No files matched your search

+7
View File
@@ -114,6 +114,13 @@ class Assets(models.AbstractModel):
updatedFileContent = self.get_asset_content(custom_url) or self.get_asset_content(url)
updatedFileContent = updatedFileContent.decode('utf-8')
for name, value in values.items():
# Protect variable names so they cannot be computed as numbers
# on SCSS compilation (e.g. var(--700) => var(700)).
if isinstance(value, str):
value = re.sub(
r"var\(--([0-9]+)\)",
lambda matchobj: "var(--#{" + matchobj.group(1) + "})",
value)
pattern = "'%s': %%s,\n" % name
regex = re.compile(pattern % ".+")
replacement = pattern % value