Skip to content

Commit

Permalink
Update warning message design
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriquerPimentel committed Apr 4, 2024
1 parent 9d77db4 commit 1391d7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/markup/csv/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ 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(`ui top attached warning message`)},
{Element: "div", AllowAttr: "class", Regexp: regexp.MustCompile(`tw-flex tw-justify-center tw-items-center`)},
{Element: "a", AllowAttr: "href", Regexp: regexp.MustCompile(`\?display=source`)},
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ func (r Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.W
locale := ctx.Ctx.Value(translation.ContextKey).(translation.Locale)

// Construct the HTML string
warn := `<div class="ui top attached warning message" tabindex="0">` + locale.TrString("repo.file_too_large") + ` <b><a class="source" href="?display=source">` + locale.TrString("repo.file_view_source") + `</a></b></div>`
warn := `<div class="tw-flex tw-justify-center tw-items-center"><div>` + locale.TrString("repo.file_too_large") + ` <a class="source" href="?display=source">` + locale.TrString("repo.file_view_source") + `</a></div></div>`

// Write the HTML string to the output
if _, err := warnBlock.WriteString(warn); err != nil {
Expand Down

0 comments on commit 1391d7a

Please sign in to comment.