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:----UETAxAP3s+/YV6xO+hPB8JuyQuaOMCtxRoCfyEegBwiW5Ou+DzkhDpz7Z8jvdwhuAvmR7QWxwiwa13lLd6wk52AfWdE130qEtTYwx3N0josO+z2kzwQ8InKJmz2VX/g75aqicJEmpqf5MefGERq8hFAr5XfRfgLZRJQCbR1MR4cQyfo/a1UQA/Fu7GfXzNnjA9IF8A/UeJq/A7ddHhmsjAoXOXIcqQTja56SmB9mgck1kolAN+KFIHf3rdC19iOnr8dQzbSIzO5aaQdfzmI9Vgo2JcHHNVSThGXC1zen16pULqW0NLDQ+R/wTim5RWe50yOoNn6oS638SIbAyOSYRH37rAs0bQ5tnmR4PWjzckpelEK4hpAAUUqdfLdYqE0L0q6PaK+FLDDsyH2UFJBD+Wm6tilBV1sNweAlcyie7aOJdGaNY+tj9e5WqNLOEVUnh9sg6n/iRHM/guhUF7Us/tnEc5cQhKpDXHxudLVASPLkKPdRU8ZXz06M+1AixBEjFX1QPnGmdW+9YKnnbioPwzksFhsYtPOiHVkv6/Lj9oqeTGBPfKUSPwgd2fcFzwhnxExOwNcvEdZO06k9wyfMcGeeMIkcvANe63afkL71veXroi27GCzJnUesf0yL9Hht3Haf+syz2ZlgouK6ahOTE0GQBqpQzYPasbQkVDqoe5k=----ATTACHMENT:----OTMyMzgyNzI5MTAyNzYwNiAyMTc0NDQ1NzI2ODg3OTI4IDQ1MzgzNjg2OTI4NjM4OTQ=