From d061de728fb8518808e89700b3ee3a4cdd044eff Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 31 Mar 2020 17:32:29 +0200 Subject: [PATCH] Introduce class `MarkdownText` --- library/Icingadb/Common/MarkdownText.php | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 library/Icingadb/Common/MarkdownText.php diff --git a/library/Icingadb/Common/MarkdownText.php b/library/Icingadb/Common/MarkdownText.php new file mode 100644 index 00000000..5d1a1418 --- /dev/null +++ b/library/Icingadb/Common/MarkdownText.php @@ -0,0 +1,28 @@ + 'markdown']; + + /** + * MarkdownText constructor. + * + * @param string $text + */ + public function __construct($text) + { + $this->add((new DeferredText(function () use ($text) { + return Markdown::text($text); + }))->setEscaped(true)); + } +}