environment/lib/python2.7/site-packages/IPython/frontend/qt/rich_text.py
def fix_html(html):
    """ Transforms a Qt-generated HTML string into a standards-compliant one.

    Parameters:
    -----------
    html : str,
        A utf-8 encoded Python string containing the Qt HTML.
    """
    # A UTF-8 declaration is needed for proper rendering of some characters
    # (e.g., indented commands) when viewing exported HTML on a local system
    # (i.e., without seeing an encoding declaration in an HTTP header).
    # C.f. http://www.w3.org/International/O-charset for details.
    offset = html.find('<head>')
    if offset > -1:
        html = (html[:offset+6]+
                '\n<meta http-equiv="Content-Type" '+
                'content="text/html; charset=utf-8" />\n'+
                html[offset+6:])

    # Replace empty paragraphs tags with line breaks.
    html = re.sub(EMPTY_P_RE, '<br/>', html)

    return html
def fix_html(html):
    # A UTF-8 declaration is needed for proper rendering of some characters
    # (e.g., indented commands) when viewing exported HTML on a local system
    # (i.e., without seeing an encoding declaration in an HTTP header).
    # C.f. http://www.w3.org/International/O-charset for details.
    offset = html.find('<head>')
    if offset > -1:
        html = (html[:offset+6]+
                '\n<meta http-equiv="Content-Type" '+
                'content="text/html; charset=utf-8" />\n'+
                html[offset+6:])

    # Replace empty paragraphs tags with line breaks.
    html = re.sub(EMPTY_P_RE, '<br/>', html)

    return html
def fix_html ( html ) : # A UTF-8 declaration is needed for proper rendering of some characters # (e.g., indented commands) when viewing exported HTML on a local system # (i.e., without seeing an encoding declaration in an HTTP header). # C.f. http://www.w3.org/International/O-charset for details. offset = html . find ( '<head>' ) if offset > - 1 : html = ( html [ : offset + 6 ] + '\n<meta http-equiv="Content-Type" ' + 'content="text/html; charset=utf-8" />\n' + html [ offset + 6 : ] ) # Replace empty paragraphs tags with line breaks. html = re . sub ( EMPTY_P_RE , '<br/>' , html ) return html
Transforms a Qt-generated HTML string into a standards-compliant one.

    Parameters:
    -----------
    html : str,
        A utf-8 encoded Python string containing the Qt HTML.
Transforms a Qt - generated HTML string into a standards - compliant one .