diff --git a/modules/markup/csv/csv.go b/modules/markup/csv/csv.go index 9c2e4aeebbf87..aeba98f5d622d 100644 --- a/modules/markup/csv/csv.go +++ b/modules/markup/csv/csv.go @@ -7,6 +7,7 @@ import ( "bufio" "html" "io" + "net/url" "regexp" "strconv" @@ -39,8 +40,6 @@ func (Renderer) SanitizerRules() []setting.MarkupSanitizerRule { {Element: "table", AllowAttr: "class", Regexp: regexp.MustCompile(`data-table`)}, {Element: "th", AllowAttr: "class", Regexp: regexp.MustCompile(`line-num`)}, {Element: "td", AllowAttr: "class", Regexp: regexp.MustCompile(`line-num`)}, - {Element: "div", AllowAttr: "class", Regexp: regexp.MustCompile(`tw-flex tw-justify-center tw-items-center tw-py-4 tw-text-14`)}, - {Element: "a", AllowAttr: "href", Regexp: regexp.MustCompile(``)}, } } @@ -134,10 +133,19 @@ func (r Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.W // Check if maxRows or maxSize is reached, and if true, warn. if (row >= maxRows && maxRows != 0) || (rd.InputOffset() >= maxSize && maxSize != 0) { - locale := ctx.Ctx.Value(translation.ContextKey).(translation.Locale) + warn := `