replace some code with the :empty selector