diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 2 | ||||
-rw-r--r-- | include/text.php | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index b720355af..0bf326506 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -493,7 +493,7 @@ function bb_code($match) { function bb_highlight($match) { 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'])) + 'vbscript','avrc','dtd','java','xml','cpp','python','javascript','js','json','sh'])) return text_highlight($match[2],strtolower($match[1])); return $match[0]; } diff --git a/include/text.php b/include/text.php index 50a3d8892..22f4556a8 100644 --- a/include/text.php +++ b/include/text.php @@ -2887,6 +2887,12 @@ function text_highlight($s,$lang) { if($lang === 'js') $lang = 'javascript'; + if($lang === 'json') { + $lang = 'javascript'; + if(! strpos(trim($s),"\n")) + $s = jindent($s); + } + if(! strpos('Text_Highlighter',get_include_path())) { set_include_path(get_include_path() . PATH_SEPARATOR . 'library/Text_Highlighter'); } |