diff options
Diffstat (limited to 'cgi/formatting.py')
-rw-r--r-- | cgi/formatting.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cgi/formatting.py b/cgi/formatting.py index 33495a3..cb512ab 100644 --- a/cgi/formatting.py +++ b/cgi/formatting.py @@ -336,6 +336,13 @@ def close_html(message): return message[:l] +def remove_html(message): + string = message.replace("<br />", "\n") + string = re.sub(r"<.*?>", '', string) + string = string.replace("\n", "<br />") + return string + + def sanitize_html(message, decode=True): """ Clean the code and allow only a few safe tags. |