diff --git a/library/Icinga/Web/Helper/Markdown.php b/library/Icinga/Web/Helper/Markdown.php new file mode 100644 index 000000000..4a06a78a7 --- /dev/null +++ b/library/Icinga/Web/Helper/Markdown.php @@ -0,0 +1,15 @@ +text($content)); + } +} diff --git a/library/Icinga/Web/View/helpers/string.php b/library/Icinga/Web/View/helpers/string.php index a36a0f224..bec504750 100644 --- a/library/Icinga/Web/View/helpers/string.php +++ b/library/Icinga/Web/View/helpers/string.php @@ -4,6 +4,7 @@ namespace Icinga\Web\View; use Icinga\Util\StringHelper; +use Icinga\Web\Helper\Markdown; $this->addHelperFunction('ellipsis', function ($string, $maxLength, $ellipsis = '...') { return StringHelper::ellipsis($string, $maxLength, $ellipsis); @@ -12,3 +13,7 @@ $this->addHelperFunction('ellipsis', function ($string, $maxLength, $ellipsis = $this->addHelperFunction('nl2br', function ($string) { return nl2br(str_replace(array('\r\n', '\r', '\n'), '
', $string), false); }); + +$this->addHelperFunction('markdown', function ($content) { + return Markdown::text($content); +});