summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TMarkdown.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-02-12 15:39:31 +0100
committerFabio Bas <ctrlaltca@gmail.com>2014-02-12 15:39:31 +0100
commit5abbbca5332a4e5f9b8e5fb24a45611df9b874e2 (patch)
tree6265e26949d69c8516834e2eaaf4487cf5b07e56 /framework/Web/UI/WebControls/TMarkdown.php
parentb3c782faadcbd47a723b5cd0b08559e5964f37cf (diff)
Dropped Markdown for Parsedown
Diffstat (limited to 'framework/Web/UI/WebControls/TMarkdown.php')
-rw-r--r--framework/Web/UI/WebControls/TMarkdown.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/framework/Web/UI/WebControls/TMarkdown.php b/framework/Web/UI/WebControls/TMarkdown.php
index 75ca71af..75c8ec1b 100644
--- a/framework/Web/UI/WebControls/TMarkdown.php
+++ b/framework/Web/UI/WebControls/TMarkdown.php
@@ -13,7 +13,7 @@
* Using TTextHighlighter and MarkdownParser classes
*/
Prado::using('System.Web.UI.WebControls.TTextHighlighter');
-Prado::using('System.3rdParty.Markdown.MarkdownParser');
+Prado::using('System.3rdParty.Parsedown.Parsedown');
/**
* TMarkdown class
@@ -29,7 +29,7 @@ Prado::using('System.3rdParty.Markdown.MarkdownParser');
* To use TMarkdown, simply enclose the content to be rendered within
* the body of TMarkdown in a template.
*
- * See http://www.pradosoft.com/demos/quickstart/?page=Markdown for
+ * See https://daringfireball.net/projects/markdown/basics for
* details on the Markdown syntax usage.
*
* TMarkdown also performs syntax highlighting for code blocks whose language
@@ -51,10 +51,9 @@ class TMarkdown extends TTextHighlighter
*/
public function processText($text)
{
- $renderer = new MarkdownParser;
- $result = $renderer->parse($text);
+ $result = Parsedown::instance()->parse($text);
return preg_replace_callback(
- '/<pre><code>\[\s*(\w+)\s*\]\n+((.|\n)*?)\s*<\\/code><\\/pre>/im',
+ '/<pre><code class="language-(\w+)">((.|\n)*?)<\\/code><\\/pre>/im',
array($this, 'highlightCode'), $result);
}