use regex for tidy_tags

This commit is contained in:
Daniel
2024-05-09 04:07:02 +02:00
committed by GitHub
parent 78814e1af0
commit 09d3e5add3
+4 -1
View File
@@ -34,7 +34,10 @@ class StringFunction:
else:
out = text_a.replace(text_b, text_c)
if tidy_tags:
out = out.replace(" ", " ").replace(" ,", ",").replace(",,", ",").replace(",,", ",")
out = re.sub(r"\s{2,}", " ", out)
out = out.replace(" ,", ",")
out = re.sub(r",{2,}", ",", out)
out = out.strip()
return {"ui": {"text": (out,)}, "result": (out,)}
NODE_CLASS_MAPPINGS = {