Closed tmtrademark closed 2 years ago
Hi @tmtrademark ! Thank you for catching that, I just pushed #113 with the fix :)
:tada: This issue has been resolved in version 0.6.2-alpha.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
:tada: This issue has been resolved in version 0.6.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Reproduction Steps:
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg" />
)When the length of
textContent
is checked here https://github.com/Automattic/super-cool-ad-inserter-plugin/blob/master/inc/scaip-shortcode-inserter.php#L43, it doesn't account for the fact that<img>
tags can and do get wrapped in<p>
tags. So the enclosing<p>
tagstextContent
is empty, making$text_length
zero, so the node is skipped and not added back to$blocks
.I managed to work around this like so, which is not great because we end up running
$dom->saveHtml
on every node, regardless of whether we're going to include it. However, nodes that are actually empty do still get removed.Maybe be related to some of the discourse on #73