moar terrible regexs
space or newline before closing p

this is why you shouldn't regex html.