mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-05 09:10:38 +00:00
fix iframe autoclosing
This commit is contained in:
@@ -163,6 +163,16 @@ func TestInvalidNestedTag(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidIFrame(t *testing.T) {
|
||||
input := `<iframe src="http://example.org/"></iframe>`
|
||||
expected := `<iframe src="http://example.org/" sandbox="allow-scripts allow-same-origin allow-popups" loading="lazy"></iframe>`
|
||||
output := Sanitize("http://example.org/", input)
|
||||
|
||||
if expected != output {
|
||||
t.Errorf("Wrong output:\nwant: %s\nhave: %s", expected, output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInvalidIFrame(t *testing.T) {
|
||||
input := `<iframe src="http://example.org/"></iframe>`
|
||||
expected := ``
|
||||
|
||||
Reference in New Issue
Block a user