League\CommonMark\HtmlRenderer::getOption PHP Method

getOption() public method

public getOption ( string $option, mixed $default = null ) : mixed
$option string
$default mixed
return mixed
    public function getOption($option, $default = null)
    {
        return $this->environment->getConfig('renderer/' . $option, $default);
    }

Usage Example

 /**
  * @param BlockQuote $block
  * @param HtmlRenderer $htmlRenderer
  * @param bool $inTightList
  *
  * @return HtmlElement
  */
 public function render(AbstractBlock $block, HtmlRenderer $htmlRenderer, $inTightList = false)
 {
     if (!$block instanceof BlockQuote) {
         throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
     }
     $filling = $htmlRenderer->renderBlocks($block->getChildren());
     if ($filling === '') {
         return new HtmlElement('blockquote', array(), $htmlRenderer->getOption('inner_separator', "\n"));
     }
     return new HtmlElement('blockquote', array(), $htmlRenderer->getOption('inner_separator', "\n") . $filling . $htmlRenderer->getOption('inner_separator', "\n"));
 }
All Usage Examples Of League\CommonMark\HtmlRenderer::getOption