diff -ur a/modules/markup/sanitizer.go b/modules/markup/sanitizer.go
--- a/modules/markup/sanitizer.go 2019-01-26 16:04:56.014108339 +0100
+++ b/modules/markup/sanitizer.go 2019-01-26 16:03:21.776401012 +0100
@@ -38,6 +38,16 @@
// Custom URL-Schemes
sanitizer.policy.AllowURLSchemes(setting.Markdown.CustomURLSchemes...)
+ // Allow style on span tags
+ sanitizer.policy.AllowAttrs("style").Matching(regexp.MustCompile(`^(background-)?color:[^;]+(; ?font[^;]+)?;?$`)).OnElements("span")
+
+ // Allow class attribute
+ sanitizer.policy.AllowAttrs("class").OnElements("code", "pre", "span", "div", "p", "table", "td")
+
+ // Allow table attributes
+ sanitizer.policy.AllowAttrs("width", "frame", "rules", "cellspacing", "cellpadding").OnElements("table")
+ sanitizer.policy.AllowAttrs("width").OnElements("col")
+ sanitizer.policy.AllowAttrs("align", "valign").OnElements("td")
})
}