Fix regex and lru_cache

This commit is contained in:
awsr
2025-12-28 16:59:57 -08:00
parent 811ff45f21
commit 69865cf620
+2 -2
View File
@@ -50,10 +50,10 @@ style_save = '↷'
# Configurable symbols
class SVGSymbol:
__re_display = re.compile(r"(?<=display:\s*?)\w+(?=;)")
__re_display = re.compile(r"(?<=display:)\s*?(\w+)(?=;)")
@lru_cache # Class method due to RUF001, but also mostly so the `style` method shows params in IDE
@classmethod
@lru_cache # Class method due to RUF001, but also mostly so the `style` method shows params in IDE
def __stylize(cls, svg: str, color: str | None = None, display: str | None = None):
if color:
svg = re.sub("currentColor", color, svg, count=1)