Pass the original node on generation
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php namespace Todaymade\Daux\ContentTypes;
|
||||
|
||||
use Todaymade\Daux\Config;
|
||||
use Todaymade\Daux\Tree\Content;
|
||||
|
||||
interface ContentType
|
||||
{
|
||||
@ -13,5 +14,10 @@ interface ContentType
|
||||
*/
|
||||
public function getExtensions();
|
||||
|
||||
public function convert($html);
|
||||
/**
|
||||
* @param string $raw The raw text to render
|
||||
* @param Content $node The original node we are converting
|
||||
* @return string The generated output
|
||||
*/
|
||||
public function convert($raw, Content $node);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php namespace Todaymade\Daux\ContentTypes\Markdown;
|
||||
|
||||
use Todaymade\Daux\Config;
|
||||
use Todaymade\Daux\Tree\Content;
|
||||
|
||||
class ContentType implements \Todaymade\Daux\ContentTypes\ContentType
|
||||
{
|
||||
@ -24,8 +25,8 @@ class ContentType implements \Todaymade\Daux\ContentTypes\ContentType
|
||||
return ['md', 'markdown'];
|
||||
}
|
||||
|
||||
public function convert($html)
|
||||
public function convert($raw, Content $node)
|
||||
{
|
||||
return $this->converter->convertToHtml($html);
|
||||
return $this->converter->convertToHtml($raw);
|
||||
}
|
||||
}
|
||||
|
Verwijs in nieuw issue
Block a user