def rmextrablankline(lns):
    """
    Remove excessive blank lines.

    :param lns: lines from rst file

    """
    bc = 0
    for d in lns:
        if not d.strip():
            bc = bc + 1
        else:
            bc = 0
        if bc < 3:
            yield d
