Strip standard markdown formatting

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

View File

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