@wordpress/blocks
Version:
Block API for WordPress.
18 lines (16 loc) • 458 B
JavaScript
/**
* This method check for copy pasted img elements to see if they don't have suspicious attributes.
*
* @param {Node} node The node to check.
*
* @return {void}
*/
export default function imageCorrector(node) {
if (node.nodeName !== 'IMG') {
return;
} // Remove trackers and hardly visible images.
if (node.height === 1 || node.width === 1) {
node.parentNode.removeChild(node);
}
}
//# sourceMappingURL=image-corrector.native.js.map