Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97b2fa2

Browse files
author
Skip Montanaro
committed
Bring cgi.escape docstring slightly more in line with the library ref
manual. Closes #1243553.
1 parent 0d6615f commit 97b2fa2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/cgi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,9 @@ def print_environ_usage():
10411041
# =========
10421042

10431043
def escape(s, quote=None):
1044-
"""Replace special characters '&', '<' and '>' by SGML entities."""
1044+
'''Replace special characters "&", "<" and ">" to HTML-safe sequences.
1045+
If the optional flag quote is true, the quotation mark character (")
1046+
is also translated.'''
10451047
s = s.replace("&", "&amp;") # Must be done first!
10461048
s = s.replace("<", "&lt;")
10471049
s = s.replace(">", "&gt;")

0 commit comments

Comments
 (0)