Files
HTMLKit/HTMLKit/HTMLComment.m
T
iska fade192485 Rename HTML Node Type enum values
Use HTMLNode<type> instead of HTML<type>Node
2015-02-26 20:09:27 +01:00

42 lines
646 B
Objective-C

//
// HTMLComment.m
// HTMLKit
//
// Created by Iska on 25/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLComment.h"
@implementation HTMLComment
- (instancetype)initWithData:(NSString *)data
{
self = [super initWithName:@"#comment" type:HTMLNodeComment];
if (self) {
self.data = data ?: @"";
}
return self;
}
- (NSString *)textContent
{
return self.data;
}
- (void)setTextContent:(NSString *)textContent
{
self.data = textContent ?: @"";
}
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone
{
HTMLComment *copy = [super copyWithZone:zone];
copy.data = self.data;
return copy;
}
@end