mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-27 04:07:08 +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:
parent
8e23524b18
commit
3a187eace5
3 changed files with 22 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue