Pass the original node on generation

This commit is contained in:
Stéphane Goetz
2015-07-31 12:53:22 +02:00
bovenliggende d5458c5a0f
commit d2b45a845f
4 gewijzigde bestanden met toevoegingen van 13 en 4 verwijderingen

Bestand weergeven

@ -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);
}

Bestand weergeven

@ -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);
}
}