Do this :)

pull/144/head
Henrique Dias 2017-06-30 18:03:08 +01:00
parent ecb14f7810
commit 98af5807f1
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
2 changed files with 6 additions and 2 deletions

View File

@ -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>

View File

@ -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":