From 7dc49c841c629abdada000c7a6aeb28567addf00 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 21 Dec 2023 14:25:38 +0700 Subject: [PATCH] add: hyperscript support --- htmlgenerator/htmltags.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htmlgenerator/htmltags.py b/htmlgenerator/htmltags.py index 2276da1..9e7426d 100644 --- a/htmlgenerator/htmltags.py +++ b/htmlgenerator/htmltags.py @@ -738,9 +738,10 @@ def flatattrs(attributes: dict, context: dict) -> str: if value is None: continue - if key[0] == "_": - key = key[1:] - key = key.replace("_", "-") + if key != "_": + if key[0] == "_": + key = key[1:] + key = key.replace("_", "-") if isinstance(value, bool) and key != "value": if value is True: attlist.append(f"{conditional_escape(key)}")