summaryrefslogtreecommitdiffstats
path: root/application/libraries/Pygments.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-04-02 17:24:36 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-04-02 17:28:46 +0200
commit0702e8b7b343d3b1ea421875f5d62e40d2c07d69 (patch)
treef81b8d90eb74de4b169002cb952d7d49bf65af4c /application/libraries/Pygments.php
parent648e3cb5d45fe2a1318b3115439b5e64afa45ed9 (diff)
Fix automatic highlight of svg files
They should not be highlit.. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/libraries/Pygments.php')
-rw-r--r--application/libraries/Pygments.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php
index be59beb90..24975d6a1 100644
--- a/application/libraries/Pygments.php
+++ b/application/libraries/Pygments.php
@@ -48,21 +48,21 @@ class Pygments {
});
}
+ // Allow certain types to be highlight without doing it automatically
public function should_highlight()
{
+ $typearray = array(
+ 'image/svg+xml',
+ );
+ if (in_array($this->mimetype, $typearray)) return false;
+
if ($this->mime2lexer($this->mimetype)) return true;
return false;
}
- // Allow certain types to be highlight without doing it automatically
public function can_highlight()
{
- $typearray = array(
- 'image/svg+xml',
- );
- if (in_array($this->mimetype, $typearray)) return true;
-
if ($this->mime2lexer($this->mimetype)) return true;
return false;
@@ -71,7 +71,7 @@ class Pygments {
// Return the lexer that should be used for highlighting
public function autodetect_lexer()
{
- if (!$this->can_highlight($this->mimetype)) {
+ if (!$this->should_highlight()) {
return false;
}