@wordpress/blocks
Version:
Block API for WordPress.
20 lines (19 loc) • 397 B
JavaScript
/**
* Internal dependencies
*/
import { getSibling } from './utils';
/**
* Removes trailing br elements from text-level content.
*
* @param {Element} node Node to check.
*/
export default function brRemover(node) {
if (node.nodeName !== 'BR') {
return;
}
if (getSibling(node, 'next')) {
return;
}
node.parentNode.removeChild(node);
}
//# sourceMappingURL=br-remover.js.map