return a string with HTML-safe text

def websafe(s):
    """return a string with HTML-safe text"""
    s=s.replace("<","&lt;").replace(">","&gt;")
    s=s.replace(r'\x',r' \x')
    s=s.replace("\n","<br>")
    return s