$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:----fRcnQokvrVsKVbKHGB518jbnnz8j1/sCJ+GLg6Wg4SD+ssG8KARaCx7DhZUj7JRBnKESyt/1qTs/L9Q0wI8DKKoT1E+AGKQFOfKRCdwh9fj2hfnueb2KEwHJ/MhsA+3hPuwW9smYjVT3cfuYq7SbZSeeYVYAlwvzZBzGBUvsM+6SIPr305VKYg4z40tF+xLF8LK7BvsezJjUe7ShT7ReuKdg89NdBUeMvWxZWg14v2WWdABXdZVLlDI2EnFLVPO66pr0CRSaS0SpHJLFfpXNHydnATsUjKPpL/H8Sh4L8KUdAh3jKNCt8cM65FZJktb4SZ/vLiSUkNMFNM04axIR63YiNQCuzdAgnQ6bRUIfps5KpbUjw3GO3DZceVEthviClNTbznnatmebFgSc8Dd28BIIc+u0lLx9Cjfi0ND3nnxc5Veg1ZPwnO7cU/lB1C8R0IJXnrM5vxVelMvjLv768SYtLmRMdxa9MeKZrTUx6957ZZft1bDZ08SXWDyjTIXbGKACF/2TAg73VX4Aw15Oenliiwi9h7BGJ+K9K4qZBax5QPQi+GXUuM8j6C+uElThHSVj21qBR5TsMchZYq1/Nz3Dz7glWeDCsznHDLN76vhv+uKEPyFnF/QYupI5v9JkXM6atnia1lqMpDqNEfrg7UWjaD3UmpL6x92QtoatB0M=----ATTACHMENT:----OTY5OTE5MjQ5MjY1NDY4OSA0MzI0MjIxNjI1NTIyMjEyIDg2MzQ4NzA1Njc3OTA4MzY=