League\CommonMark\ElementRendererInterface::renderBlock PHP Method

renderBlock() public method

public renderBlock ( AbstractBlock $block, boolean $inTightList = false ) : string
$block League\CommonMark\Block\Element\AbstractBlock
$inTightList boolean
return string
    public function renderBlock(AbstractBlock $block, $inTightList = false);

Usage Example

 /**
  * Converts CommonMark to HTML.
  *
  * @param string $commonMark
  *
  * @return string
  *
  * @api
  */
 public function convertToHtml($commonMark)
 {
     $documentAST = $this->docParser->parse($commonMark);
     return $this->htmlRenderer->renderBlock($documentAST);
 }