MCPcopy Index your code
hub / github.com/postlight/parser / removeEmpty

Function removeEmpty

src/utils/dom/remove-empty.js:1–9  ·  view source on GitHub ↗
($article, $)

Source from the content-addressed store, hash-verified

1export 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}

Callers 2

extractCleanNodeFunction · 0.90

Calls 1

$Function · 0.85

Tested by

no test coverage detected