summaryrefslogtreecommitdiff
path: root/htmtl/attribute_parsers/inner_text.py
diff options
context:
space:
mode:
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