summaryrefslogtreecommitdiff
path: root/app/Core/Helper.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-01-25 12:23:27 -0500
committerFrederic Guillot <fred@kanboard.net>2015-01-25 12:23:27 -0500
commit0812ceedde2f89a8e4b391e58d6463f832ecec8e (patch)
tree2653eb64866eae8bcf93c24a643b7d2b1110a060 /app/Core/Helper.php
parente506648cbcda0b6021cf0a3b5e2f6381d8f1d0ea (diff)
Merge fix #545, fix invalid HTML when linking to URLs with numeric fragment identifiers and update Parsedown
Diffstat (limited to 'app/Core/Helper.php')
-rw-r--r--app/Core/Helper.php22
1 files changed, 3 insertions, 19 deletions
diff --git a/app/Core/Helper.php b/app/Core/Helper.php
index dbe5a271..0b267797 100644
--- a/app/Core/Helper.php
+++ b/app/Core/Helper.php
@@ -3,7 +3,6 @@
namespace Core;
use Pimple\Container;
-use Parsedown;
/**
* Template helpers
@@ -474,24 +473,9 @@ class Helper
*/
public function markdown($text, array $link = array())
{
- $html = Parsedown::instance()
- ->setMarkupEscaped(true) # escapes markup (HTML)
- ->text($text);
-
- // Replace task #123 by a link to the task
- if (! empty($link) && preg_match_all('!#(\d+)!i', $html, $matches, PREG_SET_ORDER)) {
-
- foreach ($matches as $match) {
-
- $html = str_replace(
- $match[0],
- $this->a($match[0], $link['controller'], $link['action'], $link['params'] + array('task_id' => $match[1])),
- $html
- );
- }
- }
-
- return $html;
+ $parser = new Markdown($link, $this);
+ $parser->setMarkupEscaped(true);
+ return $parser->text($text);
}
/**