summaryrefslogtreecommitdiff
path: root/htmtl/attribute_parsers/outer_text.py
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2024-12-30 20:24:23 +0200
committerAsko Nõmm <asko@nmm.ee>2024-12-30 20:24:23 +0200
commit1017edd34bff48fee7362e48838d94e8fd11bdad (patch)
tree9bf882c7d520676f429d48370ae9da383ddc24ab /htmtl/attribute_parsers/outer_text.py
parent1ac6564a775835dd9bc93a2fb48ef87f9fc2daed (diff)
bump
Diffstat (limited to 'htmtl/attribute_parsers/outer_text.py')
-rw-r--r--htmtl/attribute_parsers/outer_text.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/htmtl/attribute_parsers/outer_text.py b/htmtl/attribute_parsers/outer_text.py
new file mode 100644
index 0000000..8d89b14
--- /dev/null
+++ b/htmtl/attribute_parsers/outer_text.py
@@ -0,0 +1,8 @@
+from dompa.nodes import Node, TextNode
+from ..attribute_parser import AttributeParser
+
+
+class OuterText(AttributeParser):
+ def traverse(self, node: Node):
+ if "outer-text" in node.attributes:
+ node.replace_with(TextNode(value=self.expression(node.attributes["outer-text"])))