iabudiab / HTMLKit

An Objective-C framework for your everyday HTML needs.
MIT License
239 stars 27 forks source link

nextSiblingElement returns itself for any HTMLElement #28

Closed vladvlasov256 closed 6 years ago

vladvlasov256 commented 6 years ago

HTMLNode.m, line 128

- (HTMLElement *)nextSiblingElement
{
    HTMLNode *node = self.previousSibling;
    while (node && node.nodeType != HTMLNodeElement) {
        node = node.nextSibling;
    }
    return node.asElement;
}

Because of an iteration starts with a previous element the next sibling element it the element itself. Possibly a typo.

iabudiab commented 6 years ago

@CRivlaldo Nice catch! Thanks for the fix. Will release soon.