mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-03 15:47:14 -04:00
Many optimizations and new syntax files
This commit is contained in:
+2
-2
@@ -2,11 +2,11 @@ package highlight
|
||||
|
||||
func DetectFiletype(defs []*Def, filename string, firstLine []byte) *Def {
|
||||
for _, d := range defs {
|
||||
if d.ftdetect[0].Match([]byte(filename)) {
|
||||
if d.ftdetect[0].MatchString(filename) {
|
||||
return d
|
||||
}
|
||||
if len(d.ftdetect) > 1 {
|
||||
if d.ftdetect[1].Match(firstLine) {
|
||||
if d.ftdetect[1].MatchString(string(firstLine)) {
|
||||
return d
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user