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
|
@ -34,12 +34,13 @@
|
|||
{{end}}
|
||||
</div>
|
||||
<div class="ui bottom attached active tab segment" data-tab="write">
|
||||
<textarea id="edit_area" name="content" class="gt-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
|
||||
<textarea id="edit_area" name="content" class="gt-hidden"
|
||||
data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
|
||||
data-url="{{.Repository.Link}}/markup"
|
||||
data-context="{{.RepoLink}}"
|
||||
data-previewable-extensions="{{.PreviewableExtensions}}"
|
||||
data-line-wrap-extensions="{{.LineWrapExtensions}}">
|
||||
{{.FileContent}}</textarea>
|
||||
data-line-wrap-extensions="{{.LineWrapExtensions}}"
|
||||
data-initial-value="{{JsonUtils.EncodeToString .FileContent}}"></textarea>
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="ui bottom attached tab segment markup" data-tab="preview">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue