diff --git a/puepy/core.py b/puepy/core.py index 330bd6d..bf4e7e6 100644 --- a/puepy/core.py +++ b/puepy/core.py @@ -831,9 +831,10 @@ def generate_tag(self, tag_name, *children, **kwargs): raise Exception("t.generate_tag called without a context") # Determine ref value - ref_part = f"__{parent.ref}.{tag_name}{len(parent.children) + 1}_" + binascii.hexlify( - hashlib.sha256(str(kwargs).encode()).digest() - )[:8].decode("utf8") + ref_part = "__" + ( + f"{parent.ref}.{tag_name}{len(parent.children) + 1}_" + + (binascii.hexlify(hashlib.sha256(str(kwargs).encode()).digest()))[:8].decode("utf8") + ).lstrip("_") ref = kwargs.pop("ref", ref_part)