code: def highlightBlock(self, text):
          
          # Note that an undefined blockstate is equal to -1, so the first block
          # will have the correct behaviour of starting at 0.
          if self._allow_highlight:
              start = self.previousBlockState() + 1
              end = start + len(text)
              for i, (fmt, letter) in enumerate(self._charlist[start:end]):
                  self.setFormat(i, 1, fmt)
              self.setCurrentBlockState(end)
              self.highlight_spaces(text)
docs: Actually highlight the block