Wrap consecutive inline elements and text nodes in a P element