mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-07 20:08:48 +00:00
Adding support to detect the difference between a Grails gsp and a Gosu gsp.
This commit is contained in:
@@ -432,6 +432,19 @@ module Linguist
|
||||
Language['R']
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Internal: Guess language of .gsp files.
|
||||
#
|
||||
# Returns a Language.
|
||||
def guess_gsp_language
|
||||
if lines.grep(/<%|<%@|${|<%|<g:|<meta name="layout"|<r:/).any?
|
||||
Language['Groovy Server Pages']
|
||||
else
|
||||
Language['Gosu']
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Internal: Guess language from the first line.
|
||||
#
|
||||
|
||||
@@ -379,6 +379,16 @@ Groovy:
|
||||
- .gradle
|
||||
- .groovy
|
||||
|
||||
Groovy Server Pages:
|
||||
group: Groovy
|
||||
lexer: Java Server Page
|
||||
overrides:
|
||||
- .gsp
|
||||
aliases:
|
||||
- gsp
|
||||
extensions:
|
||||
- .gsp
|
||||
|
||||
HTML:
|
||||
type: markup
|
||||
primary_extension: .html
|
||||
|
||||
Reference in New Issue
Block a user