mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Also recognize a few well known MIME types as being textual
This commit is contained in:
parent
41fb3c79c5
commit
b9c324586e
1 changed files with 10 additions and 1 deletions
|
|
@ -25,8 +25,17 @@ type Input struct {
|
|||
extra_mime_types []string
|
||||
}
|
||||
|
||||
var known_textual_mimes = map[string]bool{
|
||||
"application/x-sh": true,
|
||||
"application/x-csh": true,
|
||||
"application/x-shellscript": true,
|
||||
"application/json": true,
|
||||
"application/rss+xml": true,
|
||||
"application/xhtml+xml": true,
|
||||
}
|
||||
|
||||
func is_textual_mime(x string) bool {
|
||||
return strings.HasPrefix(x, "text/")
|
||||
return strings.HasPrefix(x, "text/") || known_textual_mimes[x]
|
||||
}
|
||||
|
||||
func is_text_plain_mime(x string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue