From 551c359d8e50608093ba0f7179bd311d89e90da2 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 22 Sep 2013 20:31:35 +0200 Subject: 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 --- application/models/mfile.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'application') 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', ); -- cgit v1.2.3-24-g4f1b