mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Add canonical state renderable to provide default implementation for
renderables to be trivially state renderable
This commit is contained in:
parent
23560bfa33
commit
23cfbd153c
17
src/Html/Renderables/CanonicalStateRenderable.php
Normal file
17
src/Html/Renderables/CanonicalStateRenderable.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Erusev\Parsedown\Html\Renderables;
|
||||
|
||||
use Erusev\Parsedown\Html\Renderable;
|
||||
use Erusev\Parsedown\State;
|
||||
|
||||
trait CanonicalStateRenderable
|
||||
{
|
||||
/**
|
||||
* @return Renderable
|
||||
*/
|
||||
public function renderable(State $State)
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -7,6 +7,8 @@ use Erusev\Parsedown\Html\Sanitisation\Escaper;
|
||||
|
||||
final class Text implements Renderable
|
||||
{
|
||||
use CanonicalStateRenderable;
|
||||
|
||||
/** @var string */
|
||||
private $text;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user