Beispiel #1
0
 public function leaveListBlock(ListBlock $listBlock)
 {
     $type = $listBlock->getType();
     $start = $listBlock->getStart();
     if ($type == 'ol') {
         $tag = Tag::block('ol');
         if ($start > 1) {
             $tag->setAttribute('start', $start);
         }
     } else {
         $tag = Tag::block('ul');
     }
     $tag->setText($this->popBuffer());
     $this->buffer->append($tag)->append("\n");
 }
Beispiel #2
0
 protected function addItemToList($text, ListBlock $list)
 {
     $text = new Text(rtrim($text));
     $item = new ListItem();
     $list->addChild($item);
     $this->first->parseBlock($text, $item);
     if ($list->isTerse()) {
         $item->terse();
     }
 }