diff options
Diffstat (limited to 'modules/markup/sanitizer.go')
-rw-r--r-- | modules/markup/sanitizer.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/markup/sanitizer.go b/modules/markup/sanitizer.go index c8f9de33b5..5ff26a3109 100644 --- a/modules/markup/sanitizer.go +++ b/modules/markup/sanitizer.go @@ -52,8 +52,11 @@ func InitializeSanitizer() { func createDefaultPolicy() *bluemonday.Policy { policy := bluemonday.UGCPolicy() + + // For JS code copy and Mermaid loading state + policy.AllowAttrs("class").Matching(regexp.MustCompile(`^code-block( is-loading)?$`)).OnElements("pre") + // For Chroma markdown plugin - policy.AllowAttrs("class").Matching(regexp.MustCompile(`^is-loading$`)).OnElements("pre") policy.AllowAttrs("class").Matching(regexp.MustCompile(`^(chroma )?language-[\w-]+$`)).OnElements("code") // Checkboxes |