From f7bfdf58def6aadc922e1632f407d1418269a0d7 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 9 Jul 2022 19:40:17 +0300 Subject: initial --- handler/admin/MarkdownPreview.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 handler/admin/MarkdownPreview.php (limited to 'handler/admin/MarkdownPreview.php') diff --git a/handler/admin/MarkdownPreview.php b/handler/admin/MarkdownPreview.php new file mode 100644 index 0000000..e513709 --- /dev/null +++ b/handler/admin/MarkdownPreview.php @@ -0,0 +1,22 @@ +input('md, title, b:use_image_previews'); + + $html = \markup::markdownToHtml($md, $use_image_previews); + + $ctx = new \SkinContext('\\skin\\admin'); + $html = $ctx->markdownPreview( + unsafe_html: $html, + title: $title + ); + return new \AjaxOkResponse(['html' => $html]); + } + +} \ No newline at end of file -- cgit v1.2.3