diff options
Diffstat (limited to 'htmtl/attribute_parsers/outer_text.py')
| -rw-r--r-- | htmtl/attribute_parsers/outer_text.py | 8 |
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"]))) |
