improved <p> and <div> parser