@@ -139,13 +139,13 @@ - (HTMLElement *)containerForBlock:(NSNumber *)currentParagraphType
139139 return outer;
140140 }
141141
142- BOOL isTheSameBlock = currentParagraphType == previousParagraphType;
142+ BOOL isTheSameParagraph = currentParagraphType == previousParagraphType;
143143 id <BaseStyleProtocol> styleObject = _styles[currentParagraphType];
144144 Class styleClass = styleObject.class ;
145145
146146 BOOL hasSubTags = [styleClass subTagName ] != NULL ;
147147
148- if (isTheSameBlock && hasSubTags)
148+ if (isTheSameParagraph && hasSubTags)
149149 return previousNode;
150150
151151 HTMLElement *outer = [HTMLElement new ];
@@ -187,32 +187,30 @@ - (HTMLNode *)getInlineStyleNodes:(NSAttributedString *)text
187187 for (NSNumber *sty in _inlineOrder) {
188188
189189 id <BaseStyleProtocol> obj = _styles[sty];
190- Class cls = obj.class ;
190+ Class styleClass = obj.class ;
191191
192- NSString *key = [cls attributeKey ];
192+ NSString *key = [styleClass attributeKey ];
193193 id v = attrs[key];
194194
195195 if (!v || ![obj styleCondition: v range: range])
196196 continue ;
197197
198198 HTMLElement *wrap = [HTMLElement new ];
199- const char *tag = [cls tagName ];
199+ const char *tag = [styleClass tagName ];
200200
201201 wrap.tag = tag;
202202 wrap.attributes =
203- [cls respondsToSelector: @selector (getParametersFromValue: )]
204- ? [cls getParametersFromValue: v]
203+ [styleClass respondsToSelector: @selector (getParametersFromValue: )]
204+ ? [styleClass getParametersFromValue: v]
205205 : nullptr ;
206- wrap.selfClosing = [cls isSelfClosing ];
206+ wrap.selfClosing = [styleClass isSelfClosing ];
207207 [wrap.children addObject: currentNode];
208208 currentNode = wrap;
209209 }
210210
211211 return currentNode;
212212}
213213
214- #pragma mark - Rendering
215-
216214- (void )createHtmlFromNode : (HTMLNode *)node
217215 into : (NSMutableData *)buf
218216 pretify : (BOOL )pretify {
@@ -225,25 +223,27 @@ - (void)createHtmlFromNode:(HTMLNode *)node
225223 if (![node isKindOfClass: [HTMLElement class ]])
226224 return ;
227225
228- HTMLElement *el = (HTMLElement *)node;
226+ HTMLElement *element = (HTMLElement *)node;
229227
230- BOOL addNewLineBefore = pretify && isBlockTag (el .tag );
231- BOOL addNewLineAfter = pretify && needsNewLineAfter (el .tag );
228+ BOOL addNewLineBefore = pretify && isBlockTag (element .tag );
229+ BOOL addNewLineAfter = pretify && needsNewLineAfter (element .tag );
232230
233- if (el.selfClosing ) {
234- appendSelfClosingTagC (buf, el.tag , el.attributes , addNewLineBefore);
231+ if (element.selfClosing ) {
232+ appendSelfClosingTag (buf, element.tag , element.attributes ,
233+ addNewLineBefore);
235234 return ;
236235 }
237236
238- appendOpenTagC (buf, el.tag , el.attributes ?: nullptr , addNewLineBefore);
237+ appendOpenTag (buf, element.tag , element.attributes ?: nullptr ,
238+ addNewLineBefore);
239239
240- for (HTMLNode *child in el .children )
240+ for (HTMLNode *child in element .children )
241241 [self createHtmlFromNode: child into: buf pretify: pretify];
242242
243243 if (addNewLineAfter)
244244 appendC (buf, " \n " );
245245
246- appendCloseTagC (buf, el .tag );
246+ appendCloseTag (buf, element .tag );
247247}
248248
249249@end
0 commit comments