From 98af5807f10aa6068ebee95c79584ae29e54dff6 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 30 Jun 2017 18:03:08 +0100 Subject: [PATCH] Do this :) --- _assets/src/components/Editor.vue | 2 ++ file.go | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/_assets/src/components/Editor.vue b/_assets/src/components/Editor.vue index a8af7cf3..26a9d500 100644 --- a/_assets/src/components/Editor.vue +++ b/_assets/src/components/Editor.vue @@ -1,6 +1,8 @@ diff --git a/file.go b/file.go index b80f7dd1..4a0d9d22 100644 --- a/file.go +++ b/file.go @@ -201,7 +201,7 @@ func (i *file) getEditor(r *http.Request) error { hasRune := frontmatter.HasRune(i.Content) 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 { goto Error } @@ -473,11 +473,13 @@ func editorMode(language string) string { } func editorLanguage(mode string) string { - mode = strings.TrimPrefix(".", mode) + mode = strings.TrimPrefix(mode, ".") switch mode { case "md", "markdown", "mdown", "mmark": mode = "markdown" + case "yml": + mode = "yaml" case "asciidoc", "adoc", "ad": mode = "asciidoc" case "rst":