DocumentParser::rewriteURLs() to cope with extraneous spaces and refactored to use makeURL()