summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/WebControls/TMarkdown.php11
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighter.php3
2 files changed, 6 insertions, 8 deletions
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