Пример #1
0
 def escape_url(raw):
     """
     Escape urls to prevent code injection craziness. (Hopefully.)
     """
     return html.escape(quote(html.unescape(raw), safe="/#:()*?=%@+,&"))
Пример #2
0
 def escape_html(raw):
     return html.escape(html.unescape(raw)).replace("'", "'")