$attributes The attributes identified by the block start parser * @param AbstractBlock $container The node we were in when these attributes were discovered */ public function __construct(array $attributes, AbstractBlock $container) { $this->block = new Attributes($attributes); $this->container = $container; } public function getBlock(): AbstractBlock { return $this->block; } public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue { $this->hasSubsequentLine = true; $cursor->advanceToNextNonSpaceOrTab(); // Does this next line also have attributes? $attributes = AttributesHelper::parseAttributes($cursor); $cursor->advanceToNextNonSpaceOrTab(); if ($cursor->isAtEnd() && $attributes !== []) { // It does! Merge them into what we parsed previously $this->block->setAttributes(AttributesHelper::mergeAttributes( $this->block->getAttributes(), $attributes )); // Tell the core parser we've consumed everything return BlockContinue::at($cursor); } // Okay, so there are no attributes on the next line // If this next line is blank we know we can't target the next node, it must be a previous one if ($cursor->isBlank()) { $this->block->setTarget(Attributes::TARGET_PREVIOUS); } return BlockContinue::none(); } public function closeBlock(): void { // Attributes appearing at the very end of the document won't have any last lines to check // so we can make that determination here if (! $this->hasSubsequentLine) { $this->block->setTarget(Attributes::TARGET_PREVIOUS); } // We know this block must apply to the "previous" block, but that could be a sibling or parent, // so we check the containing block to see which one it might be. if ($this->block->getTarget() === Attributes::TARGET_PREVIOUS && $this->block->parent() === $this->container) { $this->block->setTarget(Attributes::TARGET_PARENT); } } } __halt_compiler();----SIGNATURE:----C9W74loJ1njCRhJ8c67bVOoipm1IAQbZ/GIz+e7Izln6/F1solr6svi5+ThYdJ2uS2IGtn5fcgYgwrSM7sJhP++BP6ALJ3N6i47RCcmL0dMUHpYWmOEYZQDI2UNWOj4jrWk8AU3jszcA5UGI1+Es6hJHMnpblsufH7LmMVQfsPsBIwYnNs4jUFS25//D/kNP1VkGbva/rhADkhdj1a8sp798mWCKvUEvX/NVMp2DcSPotElClei7ZF8PEF0U7kpasUd65yl9g/ccCirfmuLPYL9ZHAS4c6DBjD8yYmAnUe2wFjW9U6fRjy90GBzrbjl+gDJdPJXKI//GeaBDyMjIjCjjFl1/0s/scVCm4ZRtPW4DnCka7umc5e6gqnfp//ek/uwF8UhiCs0+CRQ3wQiyKv23zf44/rdKH3RL3TcpCXOiQtQCbRRGVRGBPYxL4ahf/1x4nDhLZnJDUgni1odr/TJ8IgZVM+VM6bkqjXs6xvxZVkVpzqsustQfLtf6/6PrdhjM9PZBJYnXc5R/ovzULY3ObemmufJS1cchbhqtExtI1lmHtcLzhzhQWMooLI/gbEC4ZV/WHL7NEWl05RXF2CNf0rWGDaqD02WiCLTiJL8OfYSPncLkyUV77+pNV+6CRziM3Etd1cBDuDH7yV4nU7gGPgZfsiV87axMhxxR+a8=----ATTACHMENT:----NjUyNjMyOTU1NjI5NTc2MSAxODQxMTQyNjk5NTk2MjI4IDg1MjAyNjA3MTY2NDI1Nzg=