diff --git a/lib/file.go b/lib/file.go index 38cf4f97..ac8cbd74 100644 --- a/lib/file.go +++ b/lib/file.go @@ -415,44 +415,3 @@ func isInTextExtensions(name string) bool { i := sort.SearchStrings(textExtensions, search) return i < len(textExtensions) && textExtensions[i] == search } - -// hasRune checks if the file has the frontmatter rune -func hasRune(file string) bool { - return strings.HasPrefix(file, "---") || - strings.HasPrefix(file, "+++") || - strings.HasPrefix(file, "{") -} - -func editorMode(language string) string { - switch language { - case "markdown", "asciidoc", "rst": - return "content+metadata" - } - - return "content" -} - -func editorLanguage(mode string) string { - 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": - mode = "rst" - case "html", "htm", "xml": - mode = "htmlmixed" - case "js": - mode = "javascript" - case "go": - mode = "golang" - case "": - mode = "text" - } - - return mode -}