*/ private ArrayCollection $strings; public function __construct(int $fenceLength, string $fenceChar, int $fenceOffset) { $this->block = new FencedCode($fenceLength, $fenceChar, $fenceOffset); $this->strings = new ArrayCollection(); } public function getBlock(): FencedCode { return $this->block; } public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue { // Check for closing code fence if (! $cursor->isIndented() && $cursor->getNextNonSpaceCharacter() === $this->block->getChar()) { $match = RegexHelper::matchFirst('/^(?:`{3,}|~{3,})(?= *$)/', $cursor->getLine(), $cursor->getNextNonSpacePosition()); if ($match !== null && \strlen($match[0]) >= $this->block->getLength()) { // closing fence - we're at end of line, so we can finalize now return BlockContinue::finished(); } } // Skip optional spaces of fence offset // Optimization: don't attempt to match if we're at a non-space position if ($cursor->getNextNonSpacePosition() > $cursor->getPosition()) { $cursor->match('/^ {0,' . $this->block->getOffset() . '}/'); } return BlockContinue::at($cursor); } public function addLine(string $line): void { $this->strings[] = $line; } public function closeBlock(): void { // first line becomes info string $firstLine = $this->strings->first(); if ($firstLine === false) { $firstLine = ''; } $this->block->setInfo(RegexHelper::unescape(\trim($firstLine))); if ($this->strings->count() === 1) { $this->block->setLiteral(''); } else { $this->block->setLiteral(\implode("\n", $this->strings->slice(1)) . "\n"); } } } __halt_compiler();----SIGNATURE:----Qg7wKAFBleqBrPdEX3PWhEtOyW7G8W1Tnuoj95QgXqXmIh2It3XimHK/Io8g0H0X4uMAC0toXof7rvIAu1yM0Mc/NCK0gS00EgpKmdk/bsetF2TCWBARqQoKqs41v4f7zlEeHi3iC9rzyoJGW19ljZ4N8Lbdzchtlvn0BXG9P2RDJpfTYFGzx3Lw7nt6Oxh17OsakOY0BYB52p7IZcSEeFE/Km4iiIdFF09z6qixycubZEE53bhoDJCcAUxof7zgMU63x6ab6Whj9vcaNz2YptEtfmY2Jz7yBiLsUCnFJ8cQEfwYYEvVZ67POvkc7AmkTZRX7k2lwaV1JOk3LP7mY174PgZ+tlpBx300MevG/3NQg231lBaT3uPDWxQdgIuJ3NwBJF23d4rn+w1+z1xiUyGp3Wlvgx8VI2qmczlFVBKd1nEtAa+db3w0zkO2/qLWqnqs3JfurxvGOCPI/hoLjFz07dkdes93StysYkqdBmHV/OAkVjjPMaDH+BL6g8QlSgv3u9H9hbHPmNYCMxcLu16CTdMqwd2cwdo5iWCTek765xC+92h6V5LFeRitVx81ThiKR5Hy1aofSce6e8tINKY84jNuLI2TsYMHNpZrX5eyjgP/ihqI+zxFYUQ/o0H/9Dl6m8/NL6jiMTN00saWiKfAuLjPki7w62ewNxLRxLo=----ATTACHMENT:----NzUzNjE0NDA3ODc4MzI4OSA4NDE1Nzk1NDkxMjQ5NTIyIDUxNDg3MjgyNDE5MzI2MDY=