import re


def _add_missing_tags(html_doc):
    """Fixes a issue in the orginal HTML, where the tag <Option> is not closed..
    Changes from:
    <Select Name=Linha class='ordenacaoSelect'>
        <Option Value='510-87'>510   - AUXILIADORA
        <Option Value='620-5'>520   - TRIANGULO/24 DE OUTUBRO
    To:
    <Select Name=Linha class='ordenacaoSelect'>
        <Option Value='510-87'>510   - AUXILIADORA</Option>
        <Option Value='620-5'>520   - TRIANGULO/24 DE OUTUBRO</Option>
    """
    opened_option_tag = r'<Option'
    closed_option_re = r'</Option>'

    if re.search(closed_option_re, html_doc, re.I) is None:
        html_doc = html_doc.replace(opened_option_tag, closed_option_re + opened_option_tag)

    return html_doc