aboutsummaryrefslogtreecommitdiff
path: root/mammoth/html/nodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth/html/nodes.py')
-rw-r--r--mammoth/html/nodes.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/mammoth/html/nodes.py b/mammoth/html/nodes.py
index 3b961f2..ff31c8c 100644
--- a/mammoth/html/nodes.py
+++ b/mammoth/html/nodes.py
@@ -11,10 +11,9 @@ class TextNode(Node):
@cobble.data
-class Element(Node):
+class Tag(object):
tag_names = cobble.field()
attributes = cobble.field()
- children = cobble.field()
collapsible = cobble.field()
separator = cobble.field()
@@ -24,6 +23,32 @@ class Element(Node):
@cobble.data
+class Element(Node):
+ tag = cobble.field()
+ children = cobble.field()
+
+ @property
+ def tag_name(self):
+ return self.tag.tag_name
+
+ @property
+ def tag_names(self):
+ return self.tag.tag_names
+
+ @property
+ def attributes(self):
+ return self.tag.attributes
+
+ @property
+ def collapsible(self):
+ return self.tag.collapsible
+
+ @property
+ def separator(self):
+ return self.tag.separator
+
+
+@cobble.data
class SelfClosingElement(Node):
tag_name = cobble.field()
attributes = cobble.field()