Allow GFM checkboxes in Goldmark mode

This commit is contained in:
mathew 2022-12-24 16:56:33 -06:00
parent e3bfdf948b
commit 0e5927aae5
1 changed files with 3 additions and 0 deletions

View File

@ -198,6 +198,9 @@ func applyCommonmarkSpecial(data []byte, skipNoFollow bool, baseURL string, cfg
}
// Strip out bad HTML
policy := getSanitizationPolicy()
// Enable GFM checkboxes for CommonMark
// Technically we could skip this if the
policy.AllowAttrs("type", "disabled", "checked").OnElements("input")
policy.RequireNoFollowOnLinks(!skipNoFollow)
outHTML := string(policy.SanitizeBytes(htm))
// Strip newlines on certain block elements that render with them