diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-07-21 16:04:22 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-07-21 16:32:17 +0200 |
commit | 99fb6ca90d10648a3d2e7a16188d6ed3e0cb7e4f (patch) | |
tree | 1bff97b007e3fedc264061641fb69af447b9c807 /application/libraries/Pygments.php | |
parent | ed4969074ab3ae5834511ec551c6081b92779719 (diff) |
Add special *.asciinema.json filename0.9.18
Don't force users to name all their files asciinema.json. Give them
some room for descriptive names.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/libraries/Pygments.php')
-rw-r--r-- | application/libraries/Pygments.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php index 62229c472..082c52394 100644 --- a/application/libraries/Pygments.php +++ b/application/libraries/Pygments.php @@ -171,6 +171,14 @@ class Pygments { ); if (array_key_exists($this->filename, $namearray)) return $namearray[$this->filename]; + $longextarray = array( + '.asciinema.json' => 'asciinema', + ); + foreach ($longextarray as $key => $lexer) { + if (substr($this->filename, -strlen($key)) === $key) { + return $lexer; + } + } if (strpos($this->filename, ".") !== false) { $extension = substr($this->filename, strrpos($this->filename, ".") + 1); |