From d7fa633734a625841aef61893aaf639caa1b34dc Mon Sep 17 00:00:00 2001 From: RealStickman Date: Fri, 2 Jun 2023 17:50:50 +0200 Subject: [PATCH] Enable stripping of markdown code blocks for shuser --- plugins/shortcode-custom/Prismjsshuser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/shortcode-custom/Prismjsshuser.php b/plugins/shortcode-custom/Prismjsshuser.php index d1544b8..3850463 100644 --- a/plugins/shortcode-custom/Prismjsshuser.php +++ b/plugins/shortcode-custom/Prismjsshuser.php @@ -8,7 +8,8 @@ class Prismjsshuser extends Shortcode public function init() { $this->shortcode->getRawHandlers()->add('shuser', function(ShortcodeInterface $sc) { - $content = trim($sc->getContent(), "\n "); + $content = preg_replace('/^```.*(\n)?$/m', '', $sc->getContent()); + $content = trim($content); return '
'.$content.'
'; }); }