diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-09-22 20:31:35 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-09-22 20:31:35 +0200 |
commit | 551c359d8e50608093ba0f7179bd311d89e90da2 (patch) | |
tree | d01bdb8960fad964880e5eea8d062b9f2b52910b | |
parent | 41c5abd4e8849e6a84ed2af405e9c25a74e018f3 (diff) |
Add some more file extension -> lexer mappings
Mimetype detection doesn't always properly detect code (I saw javascript as
plain text, c as asm) and if there is an extension we can likely get
better result by using that.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | application/models/mfile.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/application/models/mfile.php b/application/models/mfile.php index e862f1930..e70b5c812 100644 --- a/application/models/mfile.php +++ b/application/models/mfile.php @@ -476,11 +476,29 @@ class Mfile extends CI_Model { $extension = substr($name, strrpos($name, ".") + 1); $extensionarray = array( + 'awk' => 'awk', + 'c' => 'c', 'coffee' => 'coffee-script', + 'cpp' => 'cpp', + 'diff' => 'diff', + 'h' => 'c', + 'hs' => 'haskell', + 'html' => 'xml', + 'java' => 'java', + 'js' => 'js', + 'lua' => 'lua', 'mli' => 'ocaml', 'mll' => 'ocaml', 'ml' => 'ocaml', 'mly' => 'ocaml', + 'patch' => 'diff', + 'php' => 'php', + 'pl' => 'perl', + 'py' => 'python', + 'rb' => 'ruby', + 's' => 'asm', + 'sh' => 'bash', + 'svg' => 'xml', 'tcl' => 'tcl', 'tex' => 'tex', ); |