(diff_class, diffs)
return "".join(html)
Convert a diff array into a pretty HTML report.

    Args:
      diffs: Array of diff tuples.

    Returns:
      HTML representation.
Convert a diff array into a pretty HTML report.
Convert a diff array into a pretty HTML report .
def my_prettyHtml(diff_class, diffs):
    """Convert a diff array into a pretty HTML report.

    Args:
      diffs: Array of diff tuples.

    Returns:
      HTML representation.
    """
    html = []
    for (op, data) in diffs:
        text = (data.replace("&", "&amp;").replace("<", "&lt;")
                 .replace(">", "&gt;").replace("\n", "&para;<br>"))
        if op == diff_class.DIFF_INSERT:
            html.append("<ins class=\"diff_add\">%s</ins>" % text)
        elif op == diff_class.DIFF_DELETE:
            html.append("<del class=\"diff_sub\">%s</del>" % text)
        elif op == diff_class.DIFF_EQUAL:
            html.append("<span>%s</span>" % text)
    return "".join(html)
def my_prettyHtml ( diff_class , diffs ) : html = [ ] for ( op , data ) in diffs : text = ( data . replace ( "&" , "&amp;" ) . replace ( "<" , "&lt;" ) . replace ( ">" , "&gt;" ) . replace ( "\n" , "&para;<br>" ) ) if op == diff_class . DIFF_INSERT : html . append ( "<ins class=\"diff_add\">%s</ins>" % text ) elif op == diff_class . DIFF_DELETE : html . append ( "<del class=\"diff_sub\">%s</del>" % text ) elif op == diff_class . DIFF_EQUAL : html . append ( "<span>%s</span>" % text ) return "" . join ( html )