Slightly reworked regex.

This commit is contained in:
Arfon Smith
2015-01-26 15:37:45 -06:00
parent d773c2e90d
commit 98fc4d78aa

View File

@@ -23,7 +23,7 @@ module Linguist
#
# Returns a String or nil
def self.modeline(data)
data.lines.first(5).any? { |l| l.match(/\W(?:filetype=|ft=|mode:|-\*-)\s*(\w+)/) }
data.lines.first(5).any? { |l| l.match(/\W(?:filetype=|ft=|-\*- mode:|-\*-)\s*(\w+)/) }
lang = $1
end
end