(self, token)
return element
Create an element and insert it into the tree
Create an element and insert it into the tree
Create an element and insert it into the tree
def insertElementTable(self, token):
        """Create an element and insert it into the tree"""
        element = self.createElement(token)
        if self.openElements[-1].name not in tableInsertModeElements:
            return self.insertElementNormal(token)
        else:
            # We should be in the InTable mode. This means we want to do
            # special magic element rearranging
            parent, insertBefore = self.getTableMisnestedNodePosition()
            if insertBefore is None:
                parent.appendChild(element)
            else:
                parent.insertBefore(element, insertBefore)
            self.openElements.append(element)
        return element
def insertElementTable ( self , token ) : element = self . createElement ( token ) if self . openElements [ - 1 ] . name not in tableInsertModeElements : return self . insertElementNormal ( token ) else : # We should be in the InTable mode. This means we want to do # special magic element rearranging parent , insertBefore = self . getTableMisnestedNodePosition ( ) if insertBefore is None : parent . appendChild ( element ) else : parent . insertBefore ( element , insertBefore ) self . openElements . append ( element ) return element