Skip to content

Commit efc0dc6

Browse files
committed
Fix sandbox links
1 parent f0d062d commit efc0dc6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

apps/villages/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def render_markdown(markdown_text: str) -> Markup:
103103
link_rel="noopener nofollow", # default includes noreferrer but not nofollow
104104
)
105105
inner_html = render_template("sandboxed-iframe.html", body=Markup(content_html))
106-
iFrame_html = f'<iframe sandbox="allow-scripts" class="embedded-content" srcdoc="{html.escape(inner_html, True)}"></iframe>'
106+
iFrame_html = f'<iframe sandbox="allow-scripts allow-top-navigation-by-user-activation" class="embedded-content" srcdoc="{html.escape(inner_html, True)}"></iframe>'
107107
return Markup(iFrame_html)
108108

109109

templates/sandboxed-iframe.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<html lang="en" style="background-color: transparent; margin: 0; padding: 0">
55
<head>
66
<meta charset="UTF-8">
7+
<base target="_top">
78
{% block css -%}
89
<link rel="stylesheet" href="{{ static_url_for('static', filename="css/main.css") }}">
910
{% endblock -%}

0 commit comments

Comments
 (0)