Refactor pruneURL

Move URL insertion code from pruneURL into
pruneBlank.