diff options
author | Yoan Blanc <yoan@dosimple.ch> | 2023-04-06 22:01:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 16:01:20 -0400 |
commit | 9b416b2e36a035672226d4b83c6b7e87578b17fe (patch) | |
tree | ede783a30f3de218f5db6a49d82a786b1c7c57d2 /templates | |
parent | 797babbfcbcf845fe12c8659fffa1693ec4708bb (diff) | |
download | gitea-9b416b2e36a035672226d4b83c6b7e87578b17fe.tar.gz gitea-9b416b2e36a035672226d4b83c6b7e87578b17fe.zip |
Use graceful editorconfig loader to reduce errors when loading malformed editorconfigs (#21257)
The _graceful_ should fail less when the `.editorconfig` file isn't
properly written, e.g. boolean values from YAML or unparseable numbers
(when a number is expected). As is... information is lost as the
_warning_ (a go-multierror.Error) is ignored. If anybody knows how to
send them to the UI as warning; any help is appreciated.
Closes #20694
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/view_file.tmpl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 70d33621c6..36b50e0c7f 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -1,9 +1,12 @@ <div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content"> {{- if .FileError}} + <div class="ui error message"> + <div class="text left gt-whitespace-pre">{{.FileError}}</div> + </div> + {{end}} + {{- if .FileWarning}} <div class="ui warning message"> - <div class="text left"> - <div>{{.FileError}}</div> - </div> + <div class="text left gt-whitespace-pre">{{.FileWarning}}</div> </div> {{end}} <h4 class="file-header ui top attached header gt-df gt-ac gt-sb gt-fw"> |