mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Fix regex syntax
This commit is contained in:
@@ -23,7 +23,7 @@ module Linguist
|
||||
#
|
||||
# Returns a String or nil
|
||||
def self.modeline(data)
|
||||
regex = <<-EOF
|
||||
regex =
|
||||
/(?:
|
||||
(-\*- \s* (?:mode:)? \s*) | # $1: Emacs
|
||||
(\/\* \s* vim: \s* set \s* (?:ft|filetype)=) # $2: Vim
|
||||
@@ -35,7 +35,6 @@ module Linguist
|
||||
: \s* \*\/ # otherwise close Vim syntax
|
||||
)
|
||||
)/x
|
||||
EOF
|
||||
|
||||
data.lines.first(5).any? { |l| l.match(regex) }
|
||||
lang = $3
|
||||
|
||||
Reference in New Issue
Block a user