10 lines
283 B
JavaScript
10 lines
283 B
JavaScript
|
|
function removeEmptyParagraphs() {
|
||
|
|
const paragraphs = document.querySelectorAll('p');
|
||
|
|
paragraphs.forEach(paragraph => {
|
||
|
|
if (!paragraph.textContent.trim() && !paragraph.querySelector('i')) {
|
||
|
|
paragraph.remove();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
removeEmptyParagraphs();
|