summaryrefslogtreecommitdiff
path: root/paste/util
diff options
context:
space:
mode:
Diffstat (limited to 'paste/util')
-rw-r--r--paste/util/quoting.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/paste/util/quoting.py b/paste/util/quoting.py
index b596d7f..582cc40 100644
--- a/paste/util/quoting.py
+++ b/paste/util/quoting.py
@@ -76,6 +76,13 @@ def no_quote(s):
"""
return s
+_comment_quote_re = re.compile(r'\-\s*\>')
+def comment_quote(s):
+ """
+ Quote that makes sure text can't escape a comment
+ """
+ return _comment_quote_re.sub('-&gt', str(s))
+
url_quote = urllib.quote
url_unquote = urllib.unquote