From 3d2cc3696a378d79fb4fa36e76ddc2568ad0835d Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 24 Jul 2007 02:05:56 +0000 Subject: removed geshi from the other controls. --- framework/Web/UI/WebControls/TMarkdown.php | 11 +++-------- framework/Web/UI/WebControls/TTextHighlighter.php | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/WebControls/TMarkdown.php b/framework/Web/UI/WebControls/TMarkdown.php index 04e030cb..91464e4f 100644 --- a/framework/Web/UI/WebControls/TMarkdown.php +++ b/framework/Web/UI/WebControls/TMarkdown.php @@ -67,14 +67,9 @@ class TMarkdown extends TTextHighlighter */ protected function highlightCode($matches) { - $geshi=new GeSHi(html_entity_decode($matches[2],ENT_QUOTES,'UTF-8'), $matches[1]); - if($this->getShowLineNumbers()) - $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); - $geshi->enable_classes(); - if($this->getEnableCopyCode()) - $geshi->set_header_content($this->getHeaderTemplate()); - - return $geshi->parse_code(); + $text = html_entity_decode($matches[2],ENT_QUOTES,'UTF-8'); + $this->setLanguage($matches[1]); + return parent::processText($text); } } diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index e40811d1..cacdc85a 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -27,6 +27,9 @@ Prado::using('System.Web.UI.WebControls.TTextProcessor'); * syntax. By setting {@link setShowLineNumbers ShowLineNumbers} * to true, the highlighted result may be shown with line numbers. * + * Note, TTextHighlighter requires {@link THead} to be placed on the page template + * because it needs to insert some CSS styles. + * * @author Wei Zhuo * @version $Id$ * @package System.Web.UI.WebControls -- cgit v1.2.3