Convert line breaks into <p> and <br> in an intelligent fashion.