mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Fix EOL handling in web editor (#27141)
Fixes https://github.com/go-gitea/gitea/issues/27136. This does the following for Monaco's EOL setting: 1. Use editorconfig setting if present 2. Use the file's dominant line ending as detected by monaco, which uses LF for empty file
This commit is contained in:
@@ -287,7 +287,7 @@ func editFilePost(ctx *context.Context, form forms.EditRepoFileForm, isNewFile b
|
||||
Operation: operation,
|
||||
FromTreePath: ctx.Repo.TreePath,
|
||||
TreePath: form.TreePath,
|
||||
ContentReader: strings.NewReader(strings.ReplaceAll(form.Content, "\r", "")),
|
||||
ContentReader: strings.NewReader(form.Content),
|
||||
},
|
||||
},
|
||||
Signoff: form.Signoff,
|
||||
|
Reference in New Issue
Block a user