($article, $)
| 1 | export default function removeEmpty($article, $) { |
| 2 | $article.find('p').each((index, p) => { |
| 3 | const $p = $(p); |
| 4 | if ($p.find('iframe, img').length === 0 && $p.text().trim() === '') |
| 5 | $p.remove(); |
| 6 | }); |
| 7 | |
| 8 | return $; |
| 9 | } |
no test coverage detected