def highlightBlock(self, string):
        """ Highlight a block of text. Reimplemented to highlight selectively.
        """
        if not hasattr(self, 'highlighting_on') or not self.highlighting_on:
            return

        # The input to this function is a unicode string that may contain
        # paragraph break characters, non-breaking spaces, etc. Here we acquire
        # the string as plain text so we can compare it.
        current_block = self.currentBlock()
        string = current_block.text()

        # QTextBlock::text() can still return non-breaking spaces
        # for the continuation prompt
        string = string.replace("\xa0", " ")

        # Only highlight if we can identify a prompt, but make sure not to
        # highlight the prompt.
        without_prompt = self.transform_ipy_prompt(string)
        diff = len(string) - len(without_prompt)
        if diff > 0:
            self._current_offset = diff
            super().highlightBlock(without_prompt)
 Highlight a block of text. Reimplemented to highlight selectively.
        
angrmanagement/vendor/qtconsole/frontend_widget.py