footnotes = []; $this->footnoteLinkNum = 0; $this->footnoteLinks = []; } /** * @inheritDoc */ protected function consumeParagraph($lines, $current): array { $content = []; // Consume until blank line or end condition... for ($i = $current, $count = count($lines); $i < $count; $i++) { $line = $lines[$i]; if ($line === '' || ($trimmed = ltrim($line)) === '' || ( (ctype_punct($trimmed[0]) || ctype_digit($trimmed[0])) && ( $this->identifyFencedQuote($line, $lines, $i) || $this->identifyQuote($line, $lines, $i) || $this->identifyFencedCode($line, $lines, $i) || $this->identifyFigure($line, $lines, $i) || $this->identifyFencedAside($line, $lines, $i) || $this->identifyAside($line, $lines, $i) || $this->identifyUl($line, $lines, $i) || $this->identifyOl($line, $lines, $i) || $this->identifyHr($line, $lines, $i) || $this->identifyHtml($line, $lines, $i) || $this->identifyFootnoteList($line, $lines, $i) ) ) || $this->identifyHeadline($line, $lines, $i) ) { break; } else { $content[] = ltrim($line); } } $block = [ 'paragraph', 'content' => $this->parseInline(trim(implode("\n", $content))), ]; return [$block, --$i]; } /** * @inheritDoc * * Add parsed footnotes and then post-process markup. */ function postprocess($markup): string { return parent::postprocess( $this->addParsedFootnotes($markup) ); } }