diff options
Diffstat (limited to 'app/Helper/TextHelper.php')
-rw-r--r-- | app/Helper/TextHelper.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/Helper/TextHelper.php b/app/Helper/TextHelper.php index e5aefdcf..654eb171 100644 --- a/app/Helper/TextHelper.php +++ b/app/Helper/TextHelper.php @@ -27,18 +27,30 @@ class TextHelper extends Base /** * Markdown transformation * - * @param string $text Markdown content - * @param array $link Link parameters for replacement + * @param string $text + * @param boolean $isPublicLink * @return string */ - public function markdown($text, array $link = array()) + public function markdown($text, $isPublicLink = false) { - $parser = new Markdown($this->container, $link); + $parser = new Markdown($this->container, $isPublicLink); $parser->setMarkupEscaped(MARKDOWN_ESCAPE_HTML); return $parser->text($text); } /** + * Escape Markdown text that need to be stored in HTML attribute + * + * @access public + * @param string $text + * @return mixed + */ + public function markdownAttribute($text) + { + return htmlentities($this->markdown($text), ENT_QUOTES, 'UTF-8'); + } + + /** * Format a file size * * @param integer $size Size in bytes |