diff options
-rw-r--r-- | framework/Util/TVarDumper.php | 5 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TMarkdown.php | 11 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTextHighlighter.php | 3 |
3 files changed, 8 insertions, 11 deletions
diff --git a/framework/Util/TVarDumper.php b/framework/Util/TVarDumper.php index 72591355..c1be82de 100644 --- a/framework/Util/TVarDumper.php +++ b/framework/Util/TVarDumper.php @@ -50,9 +50,8 @@ class TVarDumper self::dumpInternal($var,0);
if($highlight)
{
- Prado::using('System.3rdParty.geshi.geshi');
- $geshi = new GeSHi(self::$_output, 'vardump');
- return $geshi->parse_code();
+ $result=highlight_string("<?php\n".self::$_output,true);
+ return preg_replace('/<\\?php<br \\/>/','',$result,1);
}
else
return self::$_output;
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<weizhuo[at]gmail[dot]com>
* @version $Id$
* @package System.Web.UI.WebControls
|