Conditions | 7 |
Paths | 10 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
21 | 99 | public function convert(ElementInterface $element): string |
|
22 | 99 | { |
|
23 | $return = $this->config->getOption('hard_break') ? "\n" : " \n"; |
||
24 | |||
25 | $next = $element->getNext(); |
||
26 | if ($next) { |
||
27 | $nextValue = $next->getValue(); |
||
28 | if ($nextValue) { |
||
29 | 9 | if (\in_array(\substr($nextValue, 0, 2), ['- ', '* ', '+ '], true)) { |
|
30 | $parent = $element->getParent(); |
||
31 | 9 | if ($parent && $parent->getTagName() === 'li') { |
|
32 | $return .= '\\'; |
||
33 | 9 | } |
|
34 | 9 | } |
|
35 | 9 | } |
|
36 | 9 | } |
|
37 | 9 | ||
38 | 3 | return $return; |
|
39 | 3 | } |
|
49 |