aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php6
-rw-r--r--include/text.php4
2 files changed, 6 insertions, 4 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 3fc1e2ea4..82fa33527 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -492,9 +492,9 @@ function bb_code($match) {
}
function bb_highlight($match) {
- if(in_array($match[1],['php','css','mysql','sql','abap','diff','html','perl','ruby',
- 'vbscript','avrc','dtd','java','xml','cpp','python','javascript','sh']))
- return text_highlight($match[2],$match[1]);
+ if(in_array(strtolower($match[1]),['php','css','mysql','sql','abap','diff','html','perl','ruby',
+ 'vbscript','avrc','dtd','java','xml','cpp','python','javascript','js','sh']))
+ return text_highlight($match[2],strtolower($match[1]));
}
diff --git a/include/text.php b/include/text.php
index ec42c650d..59190a9ca 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2884,9 +2884,11 @@ function flatten_array_recursive($arr) {
function text_highlight($s,$lang) {
+ if($lang === 'js')
+ $lang = 'javascript';
+
if(! strpos('Text_Highlighter',get_include_path())) {
set_include_path(get_include_path() . PATH_SEPARATOR . 'library/Text_Highlighter');
- head_add_css('/library/Text_Highlighter/sample.css');
}
require_once('library/Text_Highlighter/Text/Highlighter.php');
require_once('library/Text_Highlighter/Text/Highlighter/Renderer/Html.php');