diff --git a/HTMLKit/HTMLComment.m b/HTMLKit/HTMLComment.m
index 263a6c4..0f5aac0 100644
--- a/HTMLKit/HTMLComment.m
+++ b/HTMLKit/HTMLComment.m
@@ -38,4 +38,11 @@
return copy;
}
+#pragma mark - Description
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"<%@: %p >", self.class, self, self.data];
+}
+
@end
diff --git a/HTMLKit/HTMLDocumentType.m b/HTMLKit/HTMLDocumentType.m
index 9ea0708..a9b20de 100644
--- a/HTMLKit/HTMLDocumentType.m
+++ b/HTMLKit/HTMLDocumentType.m
@@ -133,4 +133,12 @@ NS_INLINE BOOL nilOrEqual(id first, id second) {
return copy;
}
+#pragma mark - Description
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"<%@: %p >",
+ self.class, self, self.name, self.publicIdentifier, self.systemIdentifier];
+}
+
@end
diff --git a/HTMLKit/HTMLElement.m b/HTMLKit/HTMLElement.m
index 746287d..58fb0b6 100644
--- a/HTMLKit/HTMLElement.m
+++ b/HTMLKit/HTMLElement.m
@@ -96,4 +96,26 @@
return copy;
}
+#pragma mark - Description
+
+- (NSString *)description
+{
+ NSMutableString *description = [NSMutableString stringWithFormat:@"<%@: %p ", self.class, self];
+
+ if (self.namespace == HTMLNamespaceMathML) {
+ [description appendString:@"math "];
+ } else if (self.namespace == HTMLNamespaceSVG) {
+ [description appendString:@"svg "];
+ }
+
+ [description appendFormat:@"<%@", self.tagName];
+ [self.attributes enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+ [description appendFormat:@" %@=\"%@\"", key, obj];
+ }];
+
+ [description appendString:@">>"];
+
+ return description;
+}
+
@end
diff --git a/HTMLKit/HTMLNode.m b/HTMLKit/HTMLNode.m
index 46ff4c4..3d0c6f4 100644
--- a/HTMLKit/HTMLNode.m
+++ b/HTMLKit/HTMLNode.m
@@ -353,4 +353,10 @@ NS_INLINE void CheckInvalidCombination(HTMLNode *parent, HTMLNode *node, NSStrin
return copy;
}
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"<%@: %p %@>", self.class, self, self.name];
+}
+
@end
diff --git a/HTMLKit/HTMLText.m b/HTMLKit/HTMLText.m
index d1c74a2..10ae1dd 100644
--- a/HTMLKit/HTMLText.m
+++ b/HTMLKit/HTMLText.m
@@ -48,4 +48,11 @@
return copy;
}
+#pragma mark - Description
+
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"<%@: %p \"%@\">", self.class, self, self.data];
+}
+
@end