summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-09-22 20:31:35 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-09-22 20:31:35 +0200
commit551c359d8e50608093ba0f7179bd311d89e90da2 (patch)
treed01bdb8960fad964880e5eea8d062b9f2b52910b
parent41c5abd4e8849e6a84ed2af405e9c25a74e018f3 (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.php18
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',
);