Fix method signatures for confluence
This commit is contained in:
parent
d6e2eb5592
commit
5ada801e6d
@ -3,8 +3,8 @@
|
|||||||
use League\CommonMark\Block\Element\AbstractBlock;
|
use League\CommonMark\Block\Element\AbstractBlock;
|
||||||
use League\CommonMark\Block\Element\FencedCode;
|
use League\CommonMark\Block\Element\FencedCode;
|
||||||
use League\CommonMark\Block\Renderer\BlockRendererInterface;
|
use League\CommonMark\Block\Renderer\BlockRendererInterface;
|
||||||
|
use League\CommonMark\ElementRendererInterface;
|
||||||
use League\CommonMark\HtmlElement;
|
use League\CommonMark\HtmlElement;
|
||||||
use League\CommonMark\HtmlRendererInterface;
|
|
||||||
|
|
||||||
class FencedCodeRenderer implements BlockRendererInterface
|
class FencedCodeRenderer implements BlockRendererInterface
|
||||||
{
|
{
|
||||||
@ -43,7 +43,7 @@ class FencedCodeRenderer implements BlockRendererInterface
|
|||||||
*
|
*
|
||||||
* @return HtmlElement|string
|
* @return HtmlElement|string
|
||||||
*/
|
*/
|
||||||
public function render(AbstractBlock $block, HtmlRendererInterface $htmlRenderer, $inTightList = false)
|
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false)
|
||||||
{
|
{
|
||||||
if (!($block instanceof FencedCode)) {
|
if (!($block instanceof FencedCode)) {
|
||||||
throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
|
throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
|
||||||
@ -64,7 +64,7 @@ class FencedCodeRenderer implements BlockRendererInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLanguage($infoWords, HtmlRendererInterface $htmlRenderer)
|
public function getLanguage($infoWords, ElementRendererInterface $htmlRenderer)
|
||||||
{
|
{
|
||||||
if (count($infoWords) === 0 || strlen($infoWords[0]) === 0) {
|
if (count($infoWords) === 0 || strlen($infoWords[0]) === 0) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
use League\CommonMark\Block\Element\AbstractBlock;
|
use League\CommonMark\Block\Element\AbstractBlock;
|
||||||
use League\CommonMark\Block\Element\IndentedCode;
|
use League\CommonMark\Block\Element\IndentedCode;
|
||||||
use League\CommonMark\Block\Renderer\BlockRendererInterface;
|
use League\CommonMark\Block\Renderer\BlockRendererInterface;
|
||||||
|
use League\CommonMark\ElementRendererInterface;
|
||||||
use League\CommonMark\HtmlElement;
|
use League\CommonMark\HtmlElement;
|
||||||
use League\CommonMark\HtmlRendererInterface;
|
|
||||||
|
|
||||||
class IndentedCodeRenderer implements BlockRendererInterface
|
class IndentedCodeRenderer implements BlockRendererInterface
|
||||||
{
|
{
|
||||||
@ -15,7 +15,7 @@ class IndentedCodeRenderer implements BlockRendererInterface
|
|||||||
*
|
*
|
||||||
* @return HtmlElement
|
* @return HtmlElement
|
||||||
*/
|
*/
|
||||||
public function render(AbstractBlock $block, HtmlRendererInterface $htmlRenderer, $inTightList = false)
|
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false)
|
||||||
{
|
{
|
||||||
if (!($block instanceof IndentedCode)) {
|
if (!($block instanceof IndentedCode)) {
|
||||||
throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
|
throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
|
||||||
|
@ -42,7 +42,7 @@ class LinkRenderer extends \Todaymade\Daux\ContentTypes\Markdown\LinkRenderer
|
|||||||
];
|
];
|
||||||
|
|
||||||
$page = strval(new HtmlElement('ri:page', $link_props, '', true));
|
$page = strval(new HtmlElement('ri:page', $link_props, '', true));
|
||||||
$children = $htmlRenderer->renderInlines($inline->getChildren());
|
$children = $htmlRenderer->renderInlines($inline->children());
|
||||||
if (strpos($children, "<") !== false) {
|
if (strpos($children, "<") !== false) {
|
||||||
$children = '<ac:link-body>' . $children . '</ac:link-body>';
|
$children = '<ac:link-body>' . $children . '</ac:link-body>';
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user