The formation of sharp structures by ambipolar diffusion