forked from Mirrors/gomuks
hicli/html: fix closing font tags in html sanitizer
This commit is contained in:
parent
475a57e3f5
commit
8d201642c8
2 changed files with 8 additions and 4 deletions
|
@ -469,9 +469,13 @@ Loop:
|
|||
tagName, _ := tz.TagName()
|
||||
tag := atom.Lookup(tagName)
|
||||
if tagIsAllowed(tag) && ts.pop(tag) {
|
||||
built.WriteString("</")
|
||||
built.Write(tagName)
|
||||
built.WriteByte('>')
|
||||
if tag == atom.Font {
|
||||
built.WriteString("</span>")
|
||||
} else {
|
||||
built.WriteString("</")
|
||||
built.Write(tagName)
|
||||
built.WriteByte('>')
|
||||
}
|
||||
}
|
||||
case html.TextToken:
|
||||
if ts.contains(atom.Pre, atom.Code, atom.A) {
|
||||
|
|
|
@ -356,7 +356,7 @@ func (h *HiClient) calculateLocalContent(ctx context.Context, dbEvt *database.Ev
|
|||
return nil
|
||||
}
|
||||
|
||||
const CurrentHTMLSanitizerVersion = 1
|
||||
const CurrentHTMLSanitizerVersion = 2
|
||||
|
||||
func (h *HiClient) ReprocessExistingEvent(ctx context.Context, evt *database.Event) {
|
||||
if evt.Type != event.EventMessage.Type || evt.LocalContent == nil || evt.LocalContent.HTMLVersion >= CurrentHTMLSanitizerVersion {
|
||||
|
|
Loading…
Add table
Reference in a new issue