public function &addItemSmart($pageItem, $properties = [])
    {
        if (is_array($pageItem)) {
            foreach ($pageItem as $item) {
                $this->addItemSmart($item);
            }
            $itemAdded = &$this->lastItem;
        } else {
            if (isset($pageItem->tagType) && $pageItem->tagType == 'li') {
                $itemAdded = parent::addItem($pageItem);
            } else {
                $itemAdded = parent::addItem(new LiTag($pageItem, $properties));
            }
        }

        return $itemAdded;
    }