markup/goldmark: Exclude event attributes from markdown render hook

Fixes #9511
This commit is contained in:
Joe Mooring 2022-02-16 10:56:23 -08:00 committed by GitHub
parent b2a827c52c
commit ff545f4276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 3 deletions

View file

@ -57,6 +57,9 @@ func (a *attributesHolder) Attributes() map[string]string {
a.attributesInit.Do(func() {
a.attributes = make(map[string]string)
for _, attr := range a.astAttributes {
if strings.HasPrefix(string(attr.Name), "on") {
continue
}
a.attributes[string(attr.Name)] = string(util.EscapeHTML(attr.Value.([]byte)))
}
})