vendor/twig/markdown-extra/MarkdownRuntime.php line 23

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Twig.
  4.  *
  5.  * (c) Fabien Potencier
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Twig\Extra\Markdown;
  11. class MarkdownRuntime
  12. {
  13.     private $converter;
  14.     public function __construct(MarkdownInterface $converter)
  15.     {
  16.         $this->converter $converter;
  17.     }
  18.     public function convert(string $body): string
  19.     {
  20.         // remove indentation
  21.         if ($white substr($body0strspn($body" \t\r\n\0\x0B"))) {
  22.             $body preg_replace("{^$white}m"''$body);
  23.         }
  24.         return $this->converter->convert($body);
  25.     }
  26. }