def fixBadHtml(source):
    """
    Takes bad html lists and puts closing tags on the end of each line
    with a list tag and no closing tag.
    """
    # process each line on it's own
    source = source.split('\n')

    newSource = []
    
    for line in source:
        line = line.strip()
        # check if its a relevant line
        # we know that only entries are li's
        if '<li>' in line:
            if not '</li>' in line:
                line += '</li>'

        newSource.append(line)

    newSource = '\n'.join(newSource)
    return newSource