mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-05 08:55:34 +00:00
Merge branch 'master' into 1178
Conflicts: lib/linguist/samples.json
This commit is contained in:
@@ -241,7 +241,25 @@ module Linguist
|
||||
def lines
|
||||
@lines ||=
|
||||
if viewable? && data
|
||||
data.split(/\r\n|\r|\n/, -1)
|
||||
# `data` is usually encoded as ASCII-8BIT even when the content has
|
||||
# been detected as a different encoding. However, we are not allowed
|
||||
# to change the encoding of `data` because we've made the implicit
|
||||
# guarantee that each entry in `lines` is encoded the same way as
|
||||
# `data`.
|
||||
#
|
||||
# Instead, we re-encode each possible newline sequence as the
|
||||
# detected encoding, then force them back to the encoding of `data`
|
||||
# (usually a binary encoding like ASCII-8BIT). This means that the
|
||||
# byte sequence will match how newlines are likely encoded in the
|
||||
# file, but we don't have to change the encoding of `data` as far as
|
||||
# Ruby is concerned. This allows us to correctly parse out each line
|
||||
# without changing the encoding of `data`, and
|
||||
# also--importantly--without having to duplicate many (potentially
|
||||
# large) strings.
|
||||
encoded_newlines = ["\r\n", "\r", "\n"].
|
||||
map { |nl| nl.encode(encoding).force_encoding(data.encoding) }
|
||||
|
||||
data.split(Regexp.union(encoded_newlines), -1)
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
@@ -293,6 +293,7 @@ C++:
|
||||
- .inl
|
||||
- .tcc
|
||||
- .tpp
|
||||
- .ipp
|
||||
|
||||
C-ObjDump:
|
||||
type: data
|
||||
@@ -819,6 +820,9 @@ Groovy:
|
||||
color: "#e69f56"
|
||||
extensions:
|
||||
- .groovy
|
||||
- .grt
|
||||
- .gtpl
|
||||
- .gvy
|
||||
interpreters:
|
||||
- groovy
|
||||
|
||||
@@ -907,7 +911,7 @@ Haskell:
|
||||
Haxe:
|
||||
type: programming
|
||||
ace_mode: haxe
|
||||
color: "#346d51"
|
||||
color: "#f7941e"
|
||||
extensions:
|
||||
- .hx
|
||||
- .hxsl
|
||||
@@ -1251,6 +1255,7 @@ Markdown:
|
||||
- .md
|
||||
- .markdown
|
||||
- .mkd
|
||||
- .mkdn
|
||||
- .mkdown
|
||||
- .ron
|
||||
|
||||
@@ -1618,6 +1623,13 @@ Prolog:
|
||||
- .ecl
|
||||
- .pl
|
||||
|
||||
Propeller Spin:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
color: "#2b446d"
|
||||
extensions:
|
||||
- .spin
|
||||
|
||||
Protocol Buffer:
|
||||
type: markup
|
||||
aliases:
|
||||
@@ -1692,6 +1704,8 @@ R:
|
||||
extensions:
|
||||
- .r
|
||||
- .R
|
||||
- .Rd
|
||||
- .rd
|
||||
- .rsx
|
||||
filenames:
|
||||
- .Rprofile
|
||||
@@ -1836,6 +1850,13 @@ Rust:
|
||||
extensions:
|
||||
- .rs
|
||||
|
||||
SAS:
|
||||
type: programming
|
||||
color: "#1E90FF"
|
||||
lexer: Text only
|
||||
extensions:
|
||||
- .sas
|
||||
|
||||
SCSS:
|
||||
type: markup
|
||||
group: CSS
|
||||
@@ -1844,7 +1865,7 @@ SCSS:
|
||||
- .scss
|
||||
|
||||
SQL:
|
||||
type: programming
|
||||
type: data
|
||||
ace_mode: sql
|
||||
extensions:
|
||||
- .sql
|
||||
@@ -2193,15 +2214,19 @@ XML:
|
||||
- .ccxml
|
||||
- .clixml
|
||||
- .cproject
|
||||
- .csproj
|
||||
- .dita
|
||||
- .ditamap
|
||||
- .ditaval
|
||||
- .filters
|
||||
- .fsproj
|
||||
- .glade
|
||||
- .grxml
|
||||
- .jelly
|
||||
- .kml
|
||||
- .launch
|
||||
- .mxml
|
||||
- .nproj
|
||||
- .osm
|
||||
- .plist
|
||||
- .pluginspec
|
||||
@@ -2213,6 +2238,7 @@ XML:
|
||||
- .scxml
|
||||
- .srdf
|
||||
- .svg
|
||||
- .targets
|
||||
- .tmCommand
|
||||
- .tmLanguage
|
||||
- .tmPreferences
|
||||
@@ -2221,6 +2247,8 @@ XML:
|
||||
- .tml
|
||||
- .ui
|
||||
- .urdf
|
||||
- .vbproj
|
||||
- .vcxproj
|
||||
- .vxml
|
||||
- .wsdl
|
||||
- .wxi
|
||||
|
||||
121676
lib/linguist/samples.json
121676
lib/linguist/samples.json
File diff suppressed because it is too large
Load Diff
@@ -104,6 +104,10 @@
|
||||
# React
|
||||
- (^|/)react(-[^.]*)?(\.min)?\.js$
|
||||
|
||||
# Modernizr
|
||||
- (^|/)modernizr\-\d\.\d+(\.\d+)?(\.min)?\.js$
|
||||
- (^|/)modernizr\.custom\.\d+\.js$
|
||||
|
||||
## Python ##
|
||||
|
||||
# django
|
||||
@@ -144,7 +148,7 @@
|
||||
- (^|/)[Mm]icrosoft([Mm]vc)?([Aa]jax|[Vv]alidation)(\.debug)?\.js$
|
||||
|
||||
# NuGet
|
||||
- ^[Pp]ackages/
|
||||
- ^[Pp]ackages\/.+\.\d+\/
|
||||
|
||||
# ExtJS
|
||||
- (^|/)extjs/.*?\.js$
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Linguist
|
||||
VERSION = "2.10.15"
|
||||
VERSION = "2.11.1"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user