Skip to content

Commit

Permalink
Fix coding standards.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylry committed May 17, 2018
1 parent 6d6bd5d commit f29bad3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Converter/ListItemConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class ListItemConverter implements ConverterInterface, ConfigurationAwareInterfa
*/
protected $config;

/**
* @var string
*/
protected $listItemStyle;

/**
* @param Configuration $config
*/
Expand Down Expand Up @@ -46,15 +51,15 @@ public function convert(ElementInterface $element)
if ($list_type === 'ul') {
$list_item_style = $this->config->getOption('list_item_style', '-');
$list_item_style_alternate = $this->config->getOption('list_item_style_alternate');
if (!isset($this->list_item_style)) {
$this->list_item_style = $list_item_style_alternate ? $list_item_style_alternate : $list_item_style;
if (!isset($this->listItemStyle)) {
$this->listItemStyle = $list_item_style_alternate ? $list_item_style_alternate : $list_item_style;
}

if ($list_item_style_alternate && $level == 0 && $element->getSiblingPosition() === 1) {
$this->list_item_style = $this->list_item_style == $list_item_style ? $list_item_style_alternate : $list_item_style;
$this->listItemStyle = $this->listItemStyle == $list_item_style ? $list_item_style_alternate : $list_item_style;
}

return $prefix . $this->list_item_style . ' ' . $value . "\n";
return $prefix . $this->listItemStyle . ' ' . $value . "\n";
}

if ($list_type === 'ol' && $start = $element->getParent()->getAttribute('start')) {
Expand Down

0 comments on commit f29bad3

Please sign in to comment.