mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-08 19:22:57 +00:00
Do this :)
Former-commit-id: b064438028afa11cb75f7c58d56e397f60c91755 [formerly 84124f4d9bc46edf14f7eaf52adda519ba32eab6] [formerly 74d80c88cbfa7eda131b8e80aff9fbd2d757a215 [formerly 98af5807f10aa6068ebee95c79584ae29e54dff6]] Former-commit-id: 468e36232a93ace591e467d4565c7a4025437648 [formerly 72b4873d2ce46694aa02fc02e22c8775804c5f18] Former-commit-id: 9b9b2e1f4ea41507d4cfc2171f9606cba9d330c0
This commit is contained in:
parent
012c18cdf1
commit
90ba8e18da
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<form id="editor">
|
<form id="editor">
|
||||||
<h2 v-if="editor.type == 'complete'">Metadata</h2>
|
<h2 v-if="editor.type == 'complete'">Metadata</h2>
|
||||||
|
|
||||||
|
<h2 v-if="editor.type == 'complete'">Body</h2>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
6
file.go
6
file.go
@ -201,7 +201,7 @@ func (i *file) getEditor(r *http.Request) error {
|
|||||||
hasRune := frontmatter.HasRune(i.Content)
|
hasRune := frontmatter.HasRune(i.Content)
|
||||||
|
|
||||||
if e.Mode == "frontmatter-only" && !hasRune {
|
if e.Mode == "frontmatter-only" && !hasRune {
|
||||||
e.FrontMatter.Rune, err = frontmatter.StringFormatToRune(e.Mode)
|
e.FrontMatter.Rune, err = frontmatter.StringFormatToRune(e.Language)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
goto Error
|
goto Error
|
||||||
}
|
}
|
||||||
@ -473,11 +473,13 @@ func editorMode(language string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func editorLanguage(mode string) string {
|
func editorLanguage(mode string) string {
|
||||||
mode = strings.TrimPrefix(".", mode)
|
mode = strings.TrimPrefix(mode, ".")
|
||||||
|
|
||||||
switch mode {
|
switch mode {
|
||||||
case "md", "markdown", "mdown", "mmark":
|
case "md", "markdown", "mdown", "mmark":
|
||||||
mode = "markdown"
|
mode = "markdown"
|
||||||
|
case "yml":
|
||||||
|
mode = "yaml"
|
||||||
case "asciidoc", "adoc", "ad":
|
case "asciidoc", "adoc", "ad":
|
||||||
mode = "asciidoc"
|
mode = "asciidoc"
|
||||||
case "rst":
|
case "rst":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user