summaryrefslogtreecommitdiff
path: root/htmtl/attribute_parsers/inner_text.py
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2024-12-30 18:51:58 +0200
committerAsko Nõmm <asko@nmm.ee>2024-12-30 18:51:58 +0200
commit1ac6564a775835dd9bc93a2fb48ef87f9fc2daed (patch)
tree68bc998db7dd5d1b203671822273283eb6b6176a /htmtl/attribute_parsers/inner_text.py
parent69968c9e34ae57cfee905d94fc98ec6a83fbe92b (diff)
bump
Diffstat (limited to 'htmtl/attribute_parsers/inner_text.py')
-rw-r--r--htmtl/attribute_parsers/inner_text.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/htmtl/attribute_parsers/inner_text.py b/htmtl/attribute_parsers/inner_text.py
new file mode 100644
index 0000000..bd98010
--- /dev/null
+++ b/htmtl/attribute_parsers/inner_text.py
@@ -0,0 +1,9 @@
+from dompa.nodes import Node, TextNode
+from htmtl.attribute_parser import AttributeParser
+
+
+class InnerText(AttributeParser):
+ def traverse(self, node: Node):
+ if "inner-text" in node.attributes:
+ node.children = [TextNode(self.expression(node.attributes["inner-text"]))]
+ node.attributes.pop("inner-text") \ No newline at end of file