diff --git a/xmodule/util/misc.py b/xmodule/util/misc.py index 3aae7ef6f30c..8634d41aa05c 100644 --- a/xmodule/util/misc.py +++ b/xmodule/util/misc.py @@ -48,19 +48,21 @@ def escape_html_characters(content): # Removing HTML comments return re.sub( - r"", + r"", "", # Removing HTML CDATA re.sub( - r"", + r"", "", # Removing HTML-encoded non-breaking space characters re.sub( r"(\s| |//)+", " ", html_to_text(content) - ) - ) + ), + flags=re.DOTALL + ), + flags=re.DOTALL )