From ae9769f8b45dc1b2e68f1ec2923980850673b5e6 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 1 Jun 2013 03:55:53 -0700 Subject: [PATCH] Added [code=inline] for single line . --- e107_core/bbcodes/code.bb | 9 +++++++++ e107_core/shortcodes/batch/bbcode_shortcodes.php | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/e107_core/bbcodes/code.bb b/e107_core/bbcodes/code.bb index 27a66b8ca..1a92e160a 100644 --- a/e107_core/bbcodes/code.bb +++ b/e107_core/bbcodes/code.bb @@ -46,10 +46,19 @@ if(isset($pref['useGeshi']) && $pref['useGeshi'] && file_exists(e_PLUGIN."geshi/ } else { + + + $code_text = html_entity_decode($code_text, ENT_QUOTES, 'utf-8'); $code_text = trim($code_text); $code_text = htmlspecialchars($code_text, ENT_QUOTES, 'utf-8').''; + + if($parm == 'inline') + { + return "".$code_text.""; + } + // $highlighted_text = highlight_string($code_text, TRUE); // highlighted_text = str_replace(array("",""),"",$highlighted_text); $divClass = ($parm) ? $parm : 'code_highlight'; diff --git a/e107_core/shortcodes/batch/bbcode_shortcodes.php b/e107_core/shortcodes/batch/bbcode_shortcodes.php index f235ab5db..15e1ec960 100644 --- a/e107_core/shortcodes/batch/bbcode_shortcodes.php +++ b/e107_core/shortcodes/batch/bbcode_shortcodes.php @@ -39,7 +39,8 @@ class bbcode_shortcodes extends e_shortcode 6 => array('[h=5][/h]','Heading 6'), 7 => array('[block][/block]','Block'), 8 => array('[blockquote][/blockquote]', 'Quote'), - 9 => array('[code][/code]', 'Code') + 9 => array('[code][/code]', 'Code Block'), + 10 => array('[code=inline][/code]', 'Code Inline') );