'Potential over- & underlined title.'

def text(self, match, context, next_state):

    lineno = (self.state_machine.abs_line_number() - 1)
    overline = context[0]
    title = match.string
    underline = ''
    try:
        underline = self.state_machine.next_line()
    except EOFError:
        blocktext = ((overline + '\n') + title)
        if (len(overline.rstrip()) < 4):
            self.short_overline(context, blocktext, lineno, 2)
        else:
            msg = self.reporter.severe('Incomplete    section    title.', nodes.literal_block(blocktext, blocktext), line=lineno)
            self.parent += msg
            return ([], 'Body', [])
    source = ('%s\n%s\n%s' % (overline, title, underline))
    overline = overline.rstrip()
    underline = underline.rstrip()
    if (not self.transitions['underline'][0].match(underline)):
        blocktext = ((((overline + '\n') + title) + '\n') + underline)
        if (len(overline.rstrip()) < 4):
            self.short_overline(context, blocktext, lineno, 2)
        else:
            msg = self.reporter.severe('Missing    matching    underline    for    section    title    overline.', nodes.literal_block(source, source), line=lineno)
            self.parent += msg
            return ([], 'Body', [])
    elif (overline != underline):
        blocktext = ((((overline + '\n') + title) + '\n') + underline)
        if (len(overline.rstrip()) < 4):
            self.short_overline(context, blocktext, lineno, 2)
        else:
            msg = self.reporter.severe('Title    overline    &    underline    mismatch.', nodes.literal_block(source, source), line=lineno)
            self.parent += msg
            return ([], 'Body', [])
    title = title.rstrip()
    messages = []
    if (column_width(title) > len(overline)):
        blocktext = ((((overline + '\n') + title) + '\n') + underline)
        if (len(overline.rstrip()) < 4):
            self.short_overline(context, blocktext, lineno, 2)
        else:
            msg = self.reporter.warning('Title    overline    too    short.', nodes.literal_block(source, source), line=lineno)
            messages.append(msg)
    style = (overline[0], underline[0])
    self.eofcheck = 0
    self.section(title.lstrip(), source, style, (lineno + 1), messages)
    self.eofcheck = 1
    return ([], 'Body', [])
