Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions xmodule/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@ def escape_html_characters(content):

# Removing HTML comments
return re.sub(
r"<!--.*-->",
r"<!--.*?-->",
"",
# Removing HTML CDATA
re.sub(
r"<!\[CDATA\[.*\]\]>",
r"<!\[CDATA\[.*?\]\]>",
"",
# Removing HTML-encoded non-breaking space characters
re.sub(
r"(\s|&nbsp;|//)+",
" ",
html_to_text(content)
)
)
),
flags=re.DOTALL
),
flags=re.DOTALL
)


Expand Down