Fix iframe/video rendering

This commit is contained in:
Daniele Tonon
2023-06-06 08:10:51 +02:00
parent 397fe8a5c4
commit 83a23c3855
4 changed files with 19 additions and 2 deletions

View File

@@ -68,6 +68,16 @@ p {
margin-top: 0.5em;
}
iframe {
width: 100%;
height: 500px;
}
@media (max-width: 580px) {
iframe {
height: 250px;
}
}
.background {
position: fixed;
top: 0;

View File

@@ -141,6 +141,13 @@ a {
p {
margin-top: 0.5em;
}
iframe {
width: 100%;
height: 500px;
@media (max-width: 580px) {
height: 250px;
}
}
.background {
position: fixed;
top: 0;

View File

@@ -60,5 +60,5 @@
{{end}}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/njump/static/styles.css?v=20230604" />
<link rel="stylesheet" href="/njump/static/styles.css?v=20230606" />
</head>

View File

@@ -285,7 +285,7 @@ func sanitizeXSS(html string) string {
p.AllowElements("video", "source", "iframe")
p.AllowAttrs("controls", "width").OnElements("video")
p.AllowAttrs("src", "width").OnElements("source")
p.AllowAttrs("height", "width", "src", "frameborder").OnElements("iframe")
p.AllowAttrs("src", "frameborder").OnElements("iframe")
return p.Sanitize(html)
}