diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-11-02 23:37:00 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-11-02 23:37:00 -0400 |
commit | 9c4b8766cbdc2a4c63a03292b58cf35d981e1321 (patch) | |
tree | aa84619601ff14e7ea86b1147827f24a6fa82fa0 /src/edit/util.go | |
parent | 85db279e33804c118b019c5f1e7666798df3e1f5 (diff) |
simplemde
Diffstat (limited to 'src/edit/util.go')
-rw-r--r-- | src/edit/util.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/edit/util.go b/src/edit/util.go index 5835b10..b1950ed 100644 --- a/src/edit/util.go +++ b/src/edit/util.go @@ -33,15 +33,16 @@ func getctype(name string, content []byte) string { if ctype == "" { ctype = http.DetectContentType(content) } - return ctype -} -func istext(ctype string) bool { i := strings.Index(ctype, ";") if i == -1 { i = len(ctype) } ctype = strings.TrimSpace(strings.ToLower(ctype[0:i])) + return ctype +} + +func istext(ctype string) bool { return strings.HasPrefix(ctype, "text/") || strings.HasSuffix(ctype, "+xml") } |