From 9079fb6a0df75e351800c434cdc226fd8bc47e71 Mon Sep 17 00:00:00 2001 From: Nikita <6773262+Nikeron@users.noreply.github.com> Date: Tue, 11 Dec 2018 08:53:08 +0400 Subject: pkg/markup: support data URL of base64 encoded images (#5391) --- pkg/markup/sanitizer.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/markup/sanitizer.go') diff --git a/pkg/markup/sanitizer.go b/pkg/markup/sanitizer.go index 371f5b3f..3f1e41b7 100644 --- a/pkg/markup/sanitizer.go +++ b/pkg/markup/sanitizer.go @@ -36,6 +36,9 @@ func NewSanitizer() { sanitizer.policy.AllowAttrs("type").Matching(regexp.MustCompile(`^checkbox$`)).OnElements("input") sanitizer.policy.AllowAttrs("checked", "disabled").OnElements("input") + // Data URLs + sanitizer.policy.AllowURLSchemes("data") + // Custom URL-Schemes sanitizer.policy.AllowURLSchemes(setting.Markdown.CustomURLSchemes...) }) -- cgit v1.2.3