cgi.escape(s, quote=False)
Convert the characters '&'
, '<'
and '>'
in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the optional flag quote is true, the quotation mark character ("
) is also translated; this helps for inclusion in an HTML attribute value delimited by double quotes, as in <a href="...">
. Note that single quotes are never translated.
Deprecated since version 3.2: This function is unsafe because quote is false by default, and therefore deprecated. Use html.escape()
instead.
Please login to continue.