fix iframe autoclosing
This commit is contained in:
parent
28f08ad42a
commit
37ed856d8b
2 changed files with 17 additions and 2 deletions
|
|
@ -69,8 +69,12 @@ func Sanitize(baseURL, input string) string {
|
|||
buffer.WriteString("<" + tagName + ">")
|
||||
}
|
||||
|
||||
if wrap {
|
||||
buffer.WriteString("</iframe></div>")
|
||||
if tagName == "iframe" {
|
||||
// autoclose iframes
|
||||
buffer.WriteString("</iframe>")
|
||||
if wrap {
|
||||
buffer.WriteString("</div>")
|
||||
}
|
||||
} else {
|
||||
tagStack = append(tagStack, tagName)
|
||||
}
|
||||
|
|
@ -80,6 +84,7 @@ func Sanitize(baseURL, input string) string {
|
|||
}
|
||||
case html.EndTagToken:
|
||||
tagName := token.Data
|
||||
// iframes are autoclosed. see above
|
||||
if tagName == "iframe" {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue