| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class TableBlockConverter implements ConverterInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Converts the specified element into a parsed string. |
||
| 12 | * |
||
| 13 | * @param \League\HTMLToMarkdown\ElementInterface $element |
||
| 14 | * @return string |
||
| 15 | */ |
||
| 16 | 3 | public function convert(ElementInterface $element) |
|
| 17 | { |
||
| 18 | 3 | $lines = explode("\n", $element->getValue()); |
|
| 19 | |||
| 20 | 3 | foreach ($lines as $key => $line) { |
|
| 21 | 3 | $lines[$key] = trim($lines[$key]); |
|
| 22 | 2 | } |
|
| 23 | |||
| 24 | 3 | $lines = array_filter($lines); |
|
| 25 | |||
| 26 | 3 | return "\n" . implode("\n", (array) $lines); |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Returns the supported HTML tags. |
||
| 31 | * |
||
| 32 | * @return string[] |
||
| 33 | */ |
||
| 34 | 12 | public function getSupportedTags() |
|
| 37 | } |
||
| 38 | } |
||
| 39 |