mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Find modeline anywhere in the data
This commit is contained in:
@@ -37,7 +37,7 @@ module Linguist
|
|||||||
#
|
#
|
||||||
# Returns a String or nil
|
# Returns a String or nil
|
||||||
def self.modeline(data)
|
def self.modeline(data)
|
||||||
data.lines.first(5).any? { |l| l.match(Regex) }
|
data.match(Regex)
|
||||||
lang = $3
|
lang = $3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user