solve #68
parent
edccade28f
commit
b701d9f094
|
@ -36,6 +36,10 @@ func Pretty(content []byte) (*Content, string, error) {
|
|||
|
||||
kind := reflect.ValueOf(data).Kind()
|
||||
|
||||
if kind.String() == "invalid" {
|
||||
return &Content{}, "", nil
|
||||
}
|
||||
|
||||
object := new(Block)
|
||||
object.Type = objectType
|
||||
object.Name = mainName
|
||||
|
|
|
@ -17,7 +17,7 @@ func AppendRune(frontmatter []byte, language string) []byte {
|
|||
case "toml":
|
||||
return []byte("+++\n" + string(frontmatter) + "\n+++")
|
||||
case "json":
|
||||
return frontmatter
|
||||
return []byte("{\n" + string(frontmatter) + "\n}")
|
||||
}
|
||||
|
||||
return frontmatter
|
||||
|
|
|
@ -2,6 +2,7 @@ package handlers
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
|
@ -60,6 +61,8 @@ func GetEditor(i *file.Info) (*Editor, error) {
|
|||
break
|
||||
}
|
||||
|
||||
fmt.Println("Hey")
|
||||
|
||||
fallthrough
|
||||
case "markdown", "asciidoc", "rst":
|
||||
if frontmatter.HasRune(i.Content) {
|
||||
|
|
Loading…
Reference in New Issue