From 90f7abc1272ab835531babe14f8c43759ec1b9d1 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 21 Dec 2016 22:31:44 +0000 Subject: [PATCH] add function md2html, TODEL in function.php --- lib/php/nb.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/php/nb.php b/lib/php/nb.php index 4cb85e89..0b9fb414 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -897,6 +897,15 @@ class NB { return file_exists('/proc/cpuinfo') && preg_match('/^flags.* hypervisor/m',file_get_contents('/proc/cpuinfo')); } + public static function md2html($txt) { + static $_txt2md = null; + if ($_txt2md === null) { + require_once(dirname(__FILE__).'/parsedown/Parsedown.php'); + $_txt2md = new Parsedown(); + } + return $_txt2md->text($txt); + } + } # < Class return; -- 2.47.3