@@ -1129,7 +1129,7 @@ func UpdatePullRequest(ctx *context.Context) {
11291129 if err = pull_service .Update (ctx , issue .PullRequest , ctx .Doer , message , rebase ); err != nil {
11301130 if models .IsErrMergeConflicts (err ) {
11311131 conflictError := err .(models.ErrMergeConflicts )
1132- flashError , err := ctx .RenderToString (tplAlertDetails , map [string ]any {
1132+ flashError , err := ctx .RenderToHTML (tplAlertDetails , map [string ]any {
11331133 "Message" : ctx .Tr ("repo.pulls.merge_conflict" ),
11341134 "Summary" : ctx .Tr ("repo.pulls.merge_conflict_summary" ),
11351135 "Details" : utils .SanitizeFlashErrorString (conflictError .StdErr ) + "<br>" + utils .SanitizeFlashErrorString (conflictError .StdOut ),
@@ -1143,7 +1143,7 @@ func UpdatePullRequest(ctx *context.Context) {
11431143 return
11441144 } else if models .IsErrRebaseConflicts (err ) {
11451145 conflictError := err .(models.ErrRebaseConflicts )
1146- flashError , err := ctx .RenderToString (tplAlertDetails , map [string ]any {
1146+ flashError , err := ctx .RenderToHTML (tplAlertDetails , map [string ]any {
11471147 "Message" : ctx .Tr ("repo.pulls.rebase_conflict" , utils .SanitizeFlashErrorString (conflictError .CommitSHA )),
11481148 "Summary" : ctx .Tr ("repo.pulls.rebase_conflict_summary" ),
11491149 "Details" : utils .SanitizeFlashErrorString (conflictError .StdErr ) + "<br>" + utils .SanitizeFlashErrorString (conflictError .StdOut ),
@@ -1275,7 +1275,7 @@ func MergePullRequest(ctx *context.Context) {
12751275 ctx .JSONError (ctx .Tr ("repo.pulls.invalid_merge_option" ))
12761276 } else if models .IsErrMergeConflicts (err ) {
12771277 conflictError := err .(models.ErrMergeConflicts )
1278- flashError , err := ctx .RenderToString (tplAlertDetails , map [string ]any {
1278+ flashError , err := ctx .RenderToHTML (tplAlertDetails , map [string ]any {
12791279 "Message" : ctx .Tr ("repo.editor.merge_conflict" ),
12801280 "Summary" : ctx .Tr ("repo.editor.merge_conflict_summary" ),
12811281 "Details" : utils .SanitizeFlashErrorString (conflictError .StdErr ) + "<br>" + utils .SanitizeFlashErrorString (conflictError .StdOut ),
@@ -1288,7 +1288,7 @@ func MergePullRequest(ctx *context.Context) {
12881288 ctx .JSONRedirect (issue .Link ())
12891289 } else if models .IsErrRebaseConflicts (err ) {
12901290 conflictError := err .(models.ErrRebaseConflicts )
1291- flashError , err := ctx .RenderToString (tplAlertDetails , map [string ]any {
1291+ flashError , err := ctx .RenderToHTML (tplAlertDetails , map [string ]any {
12921292 "Message" : ctx .Tr ("repo.pulls.rebase_conflict" , utils .SanitizeFlashErrorString (conflictError .CommitSHA )),
12931293 "Summary" : ctx .Tr ("repo.pulls.rebase_conflict_summary" ),
12941294 "Details" : utils .SanitizeFlashErrorString (conflictError .StdErr ) + "<br>" + utils .SanitizeFlashErrorString (conflictError .StdOut ),
@@ -1318,7 +1318,7 @@ func MergePullRequest(ctx *context.Context) {
13181318 if len (message ) == 0 {
13191319 ctx .Flash .Error (ctx .Tr ("repo.pulls.push_rejected_no_message" ))
13201320 } else {
1321- flashError , err := ctx .RenderToString (tplAlertDetails , map [string ]any {
1321+ flashError , err := ctx .RenderToHTML (tplAlertDetails , map [string ]any {
13221322 "Message" : ctx .Tr ("repo.pulls.push_rejected" ),
13231323 "Summary" : ctx .Tr ("repo.pulls.push_rejected_summary" ),
13241324 "Details" : utils .SanitizeFlashErrorString (pushrejErr .Message ),
@@ -1491,7 +1491,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
14911491 ctx .JSONError (ctx .Tr ("repo.pulls.push_rejected_no_message" ))
14921492 return
14931493 }
1494- flashError , err := ctx .RenderToString (tplAlertDetails , map [string ]any {
1494+ flashError , err := ctx .RenderToHTML (tplAlertDetails , map [string ]any {
14951495 "Message" : ctx .Tr ("repo.pulls.push_rejected" ),
14961496 "Summary" : ctx .Tr ("repo.pulls.push_rejected_summary" ),
14971497 "Details" : utils .SanitizeFlashErrorString (pushrejErr .Message ),
@@ -1500,8 +1500,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
15001500 ctx .ServerError ("CompareAndPullRequest.HTMLString" , err )
15011501 return
15021502 }
1503- ctx .Flash .Error (flashError )
1504- ctx .JSONRedirect (ctx .Link + "?" + ctx .Req .URL .RawQuery ) // FIXME: it's unfriendly, and will make the content lost
1503+ ctx .JSONError (flashError )
15051504 return
15061505 }
15071506 ctx .ServerError ("NewPullRequest" , err )
0 commit comments