mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-20 20:22:10 +00:00
DRYer
This commit is contained in:
parent
102197fabe
commit
22d562ca41
2 changed files with 13 additions and 16 deletions
|
|
@ -25,23 +25,8 @@ 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/javascript": true,
|
||||
"application/json": true,
|
||||
"application/xml": true,
|
||||
"application/x-yaml": true,
|
||||
"application/yaml": true,
|
||||
"application/x-toml": true,
|
||||
"application/toml": true,
|
||||
"application/rss+xml": true,
|
||||
"application/xhtml+xml": true,
|
||||
}
|
||||
|
||||
func is_textual_mime(x string) bool {
|
||||
return strings.HasPrefix(x, "text/") || known_textual_mimes[x]
|
||||
return strings.HasPrefix(x, "text/") || utils.KnownTextualMimes[x]
|
||||
}
|
||||
|
||||
func is_text_plain_mime(x string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue