@@ -149,42 +149,6 @@ - (id)copyWithZone:(NSZone *)zone
149149 return copy;
150150}
151151
152- #pragma mark - Serialization
153-
154- - (NSString *)outerHTML
155- {
156- NSMutableString *result = [NSMutableString string ];
157-
158- [result appendFormat: @" <%@ " , self .tagName];
159- [self .attributes enumerateKeysAndObjectsUsingBlock: ^(NSString *key, NSString *value, BOOL *stop) {
160- NSMutableString *escaped = [value mutableCopy ];
161- [escaped replaceOccurrencesOfString: @" &" withString: @" &" options: 0 range: NSMakeRange (0 , escaped.length)];
162- [escaped replaceOccurrencesOfString: @" 0x00A0" withString: @" " options: 0 range: NSMakeRange (0 , escaped.length)];
163- [escaped replaceOccurrencesOfString: @" \" " withString: @" "" options: 0 range: NSMakeRange (0 , escaped.length)];
164-
165- [result appendFormat: @" %@ =\" %@ \" " , key, escaped];
166- }];
167-
168- [result appendString: @" >" ];
169-
170- if ([self .tagName isEqualToAny: @" area" , @" base" , @" basefont" , @" bgsound" , @" br" , @" col" , @" embed" ,
171- @" frame" , @" hr" , @" img" , @" input" , @" keygen" , @" link" , @" menuitem" , @" meta" , @" param" , @" source" ,
172- @" track" , @" wbr" , nil ]) {
173- return result;
174- }
175-
176- if ([self .tagName isEqualToAny: @" pre" , @" textarea" , @" listing" , nil ] && self.firstChild .nodeType == HTMLNodeText) {
177- HTMLText *textNode = (HTMLText *)self.firstChild ;
178- if ([textNode.data hasPrefix: @" \n " ]) {
179- [result appendString: @" \n " ];
180- }
181- }
182- [result appendString: self .innerHTML];
183- [result appendFormat: @" </%@ >" , self .tagName];
184-
185- return result;
186- }
187-
188152#pragma mark - Description
189153
190154- (NSString *)description
0 commit comments