public function __construct($string = '', $type = self::TYPE_BODY, $align = null) { parent::__construct(); $this->finalStringContents = $string; $this->type = $type; $this->align = $align; }
public function finalize(ContextInterface $context) { parent::finalize($context); $this->finalStringContents = preg_replace('/^ */m', '', implode("\n", $this->getStrings())); // Short-circuit if ($this->finalStringContents === '' || $this->finalStringContents[0] !== '[') { return; } $cursor = new Cursor($this->finalStringContents); $referenceFound = $this->parseReferences($context, $cursor); $this->finalStringContents = $cursor->getRemainder(); if ($referenceFound && $cursor->isAtEnd()) { $this->parent->removeChild($this); } }
public function finalize(\League\CommonMark\ContextInterface $context) { parent::finalize($context); $this->finalStringContents = implode("\n", $this->getStrings()); }