lib/linguist/strategy/modeline.rb in github-linguist-5.3.3 vs lib/linguist/strategy/modeline.rb in github-linguist-6.0.0
- old
+ new
@@ -107,9 +107,11 @@
# Modeline.call(FileBlob.new("path/to/file"))
#
# Returns an Array with one Language if the blob has a Vim or Emacs modeline
# that matches a Language name or alias. Returns an empty array if no match.
def self.call(blob, _ = nil)
+ return [] if blob.symlink?
+
header = blob.first_lines(SEARCH_SCOPE).join("\n")
footer = blob.last_lines(SEARCH_SCOPE).join("\n")
Array(Language.find_by_alias(modeline(header + footer)))
end