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
2 changes: 2 additions & 0 deletions dojo_plugin/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def user_ipv4(user):
def render_markdown(s):
raw_html = build_markdown(s or "")
if "dojo" in g and (g.dojo.official or g.dojo.privileged):
raw_html = re.sub("<a", '<a target="_blank"', raw_html)
return Markup(raw_html)

markdown_tags = [
Expand All @@ -142,6 +143,7 @@ def render_markdown(s):
"p": ["data-hide"]
}
clean_html = bleach.clean(raw_html, tags=markdown_tags, attributes=markdown_attrs)
clean_html = re.sub("<a", '<a target="_blank"', clean_html)
return Markup(clean_html)

def sanitize_survey(data):
Expand Down