Swap order of removing code blocks and trimming

This commit is contained in:
RealStickman 2023-06-02 17:39:45 +02:00
parent 12e36ebee7
commit 5d1cc8584f

View File

@ -8,8 +8,8 @@ class Prismjsshroot extends Shortcode
public function init()
{
$this->shortcode->getRawHandlers()->add('shroot', function(ShortcodeInterface $sc) {
$content = trim($sc->getContent(), "\n ");
$content = preg_replace('/^```.*$/m', '', $content);
$content = trim($sc->getContent(), "\n ");
return '<pre class="command-line language-sh" data-prompt="#" data-continuation-str="\" tabindex="0"><code class="language-sh">'.$content.'</code></pre>';
});
}