*/ 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:----a4KlEOWoBLo8FULx5T9Oiq/Gn8GjguLG2JBnS7Kw2VtRkfUdlpG/KJV9apl06K2mOERjkkOsug9UGuhOnoWIPJnsMMr+JwlfgfZ2uHIaJHFHe5BSCeATtCnmOpOF3mqExu9P5HSbTy455RCpRIBCV7jh7RHB1JMuuzr7umUYffM4t+zdMWRtCrbPXMwAvK0PuetfsyfxmgztYv9li990jEAR39tPKRe5bEEXCiE0i5QJ/7GJSU+Hh1aCi7XMlPIyMU80AtmODZNp2KgYJHtJ6m1vyPPYv4l0yF7yn9LdTFsozoVnmh7wB/ZHnSQNIP1yFShGvSFtvkUh/QGITdGa85z1Zf4h5bREVyhnSaYZfBhwGCopOR+AelAPIBwrYqHh1vVheI/JOyKtz4nOaFfRrF2eBh+Irk7xr7dmMwOPI0SEDxZB+qzskrRKVwBxtW+IQP376n0CIYaODiAjpcpsjvZm3ALNXa8FEXPevP4KsXqzpVaqmkbWt/mon/AwF3utvuqJRKgpBBHhS665muewyQmpwYDkHkHqErsHjp55Fk/46DH9H0t44CuFIfstbxCum29VMTcpyO+Gbpi1uN3rGi7mEAyMPrPBuZK0P/E/ZYrr1llPbshmwcLISnDsY/bYEJUyPmiQ4pVQWns2Be/OCCZ0lzGTTuyCmCYAMz+GfZ8=----ATTACHMENT:----OTEwMjU2NzkyNDIwMjQ1IDUwMjkzMzYyODU5NTE3OTIgODcyMTc1MjQ1MDMyOTY4OQ==