'Get a text with </> markers for selected text and | as cursor.'

def aug_text(self):

    text = self.text()
    chars = list(text)
    cur_pos = self.cursorPosition()
    assert (cur_pos >= 0)
    chars.insert(cur_pos, '|')
    if self.hasSelectedText():
        selected_text = self.selectedText()
        sel_start = self.selectionStart()
        sel_end = (sel_start + len(selected_text))
        assert (sel_start > 0)
        assert (sel_end > 0)
        assert (sel_end > sel_start)
        assert (cur_pos == sel_end)
        assert (text[sel_start:sel_end] == selected_text)
        chars.insert(sel_start, '<')
        chars.insert((sel_end + 1), '>')
    return ''.join(chars)
