$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:----mChR8PJDuXOWNsSnK2HtppadU4IfJUq0idge/lGSyQX1lsDTAZ8LQuW8iOlu74gq0vhrRIw9Xhh2U2gOrizFY4U07ca9BilVt0i1kpj6lmrlg40XymuHhkRkYnL/2bBYOCaaQLvYAtx7cpdDZMUrG4sOp5RSVxXXjKq3z6HXbGae/oYQaC1GnP0zGqdThkp3TYWsH8bWhYnVNki+yS4plhDAw6eboRx2/QjwW4PsoGsb1Q3pxJOrdw1tP7Zz/aJTxMtwQcVHewGFzKSplIXxpZea1aB930dX6yg+9dWizKqVfEUs9H0eQ/KC2nJ4FafS9ESS7sHE7a6N3T6VqDi3DzzVO1w7yam+p+vbgaN6etDEudLgIR8azqgW2REixYV23IbkGzH/01UrokvssUkDv5kuJaWSVigZyo28VesbNP5//UQ+p6i6461EV9oGwqVgD9O0EQ2X8I4j3us8QPX982Rus+DcOTKl+EPA4BV0tf0flQuHAFc4in85v+cz4T2p6Sw/Ft3qcCvEa9ILDY05nl2xdNYbhc2H0WYPPaTyEB0H7+fa2eQtE3jSjRI/oDn74/mj0kBWbzLKhQhbwepi9iNWuB3bKjXgLBo9aHDxP9BZCkccxcIBt+kHXFgbhlUAS8z6G4CVCZKZJOfqJ8NUq+81M2pEaZEY4qRdhZR45Qo=----ATTACHMENT:----OTU4NTUxNTUwOTI4MjI0MyA2MjA3MDU5MzE4ODIzNDggOTU5NTI0MjQyNzI1MjcwOQ==