def insertText(self, data, parent=None):
if parent is None:<EOL><INDENT>parent = self.openElements[-<NUM_LIT:1>]<EOL><DEDENT>if (not self.insertFromTable or (self.insertFromTable and<EOL>self.openElements[-<NUM_LIT:1>].name<EOL>not in tableInsertModeElements)):<EOL><INDENT>parent.insertText(data)<EOL><DEDENT>else:<EOL><INDENT>parent, insertBefore = self.getTableMisnestedNodePosition()<EOL>parent.insertText(data, insertBefore)<EOL><DEDENT>
Insert text data.