update after stop build
All checks were successful
All checks were successful
This commit is contained in:
30
vendor/knuckleswtf/scribe/src/Tools/BladeMarkdownEngine.php
vendored
Normal file
30
vendor/knuckleswtf/scribe/src/Tools/BladeMarkdownEngine.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Knuckles\Scribe\Tools;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\View\Compilers\CompilerInterface;
|
||||
use Illuminate\View\Engines\CompilerEngine;
|
||||
|
||||
class BladeMarkdownEngine extends CompilerEngine
|
||||
{
|
||||
private \Parsedown $markdown;
|
||||
|
||||
public function __construct(CompilerInterface $compiler, ?Filesystem $files = null)
|
||||
{
|
||||
parent::__construct($compiler, $files ?: new Filesystem);
|
||||
$this->markdown = \Parsedown::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the evaluated contents of the view.
|
||||
*
|
||||
* @param mixed $path
|
||||
*/
|
||||
public function get($path, array $data = [])
|
||||
{
|
||||
$contents = parent::get($path, $data);
|
||||
|
||||
return $this->markdown->text($contents);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user