block = new ListItem($listData); } public function getBlock(): ListItem { return $this->block; } public function isContainer(): bool { return true; } public function canContain(AbstractBlock $childBlock): bool { if ($this->hadBlankLine) { // We saw a blank line in this list item, that means the list block is loose. // // spec: if any of its constituent list items directly contain two block-level elements with a blank line // between them $parent = $this->block->parent(); if ($parent instanceof ListBlock) { $parent->setTight(false); } } return true; } public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue { if ($cursor->isBlank()) { if ($this->block->firstChild() === null) { // Blank line after empty list item return BlockContinue::none(); } $activeBlock = $activeBlockParser->getBlock(); // If the active block is a code block, blank lines in it should not affect if the list is tight. $this->hadBlankLine = $activeBlock instanceof Paragraph || $activeBlock instanceof ListItem; $cursor->advanceToNextNonSpaceOrTab(); return BlockContinue::at($cursor); } $contentIndent = $this->block->getListData()->markerOffset + $this->getBlock()->getListData()->padding; if ($cursor->getIndent() >= $contentIndent) { $cursor->advanceBy($contentIndent, true); return BlockContinue::at($cursor); } // Note: We'll hit this case for lazy continuation lines, they will get added later. return BlockContinue::none(); } } __halt_compiler();----SIGNATURE:----tj5jTkoNH5gjP67dQU5tyjMYb7NyJuuvDrnDo692sRKrhch1qqNjpEdBT8bmuCPsgqMe8lWqxF/7y19eOK7qyE7iRrqfcOVt5FUGqFEod3veSvxSG2dnZhUB8gk7zX2nPAnprr3HZ0CSZfVpFdHc6qJL9cZzZTs5/pkSe03MnaT05JsLGxVc6m0ZaSD003cVYVbrj+4SNNkEr41OUz7gbtI5aeXpfLNihjzA8SqoSLNK6AIxcHHFW1x3VYVZ6QtrTUoxsqoo9wqgJ+PuCBKcezFWCnrt1Byscfdqh5WRc/baBQLV3nmyUqCZikULOjRWSIZ+xc2YaKfT7Ct+7HMllfshcrbuwrn5YqTmg1MfqjUZQSouxxafiPFB8DWaAesJQKzUo2l3dGuIBh4ddFEXykLdgVst2iG/R97hkFqoIcwV7zPZeYuulviUwDikNe+CxzAtOfQtAa7l20nxdAvQ6CGr7dOK6D1MT0kL6uiVR8OC8u82AT+rfKTiWhexxTZW4cKtfIPfMi2ZP8WHtv/uhcyG2yZ9cs811xc0tmVEzOH9mC39PTKt+CNWm9XnqdrVDy7S9l2MJVjdsHKhO72z9GzKONRvxieR0B5FRWZP58ifXEDS6YocmBjNRL2VubwbdN2FlJHL6UD0VjUrmkCcvj+TW6F3Wmk0gEg7LROTt3k=----ATTACHMENT:----OTU3Njc1NDM0NTY0Njg4IDQ0MzQ2Njg4MTk0MDIyOSAyNjc5NjY0NDAzNTQ2MTI1