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