-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathHTMLComment.m
More file actions
47 lines (35 loc) · 722 Bytes
/
HTMLComment.m
File metadata and controls
47 lines (35 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// HTMLComment.m
//
// Public domain. https://github.com/nolanw/HTMLReader
#import "HTMLComment.h"
NS_ASSUME_NONNULL_BEGIN
@implementation HTMLComment
- (instancetype)initWithData:(NSString *)data
{
NSParameterAssert(data);
if ((self = [super init])) {
_data = [data copy];
}
return self;
}
- (instancetype)init
{
return [self initWithData:@""];
}
- (NSString *)textContent
{
return self.data;
}
- (void)setTextContent:(NSString *)textContent
{
self.data = textContent;
}
#pragma mark NSCopying
- (id)copyWithZone:(NSZone * __nullable)zone
{
HTMLComment *copy = [super copyWithZone:zone];
copy->_data = self.data;
return copy;
}
@end
NS_ASSUME_NONNULL_END